How to create a new graphics object with the same properties as an old graphics object - DOTNET

This is a discussion on How to create a new graphics object with the same properties as an old graphics object - DOTNET ; I just posted this in VB group and then thought this NG might be more appropriate. I have an image and a graphics object created (FromImage) from that image. I need to create a new image and create a new ...

+ Reply to Thread
Results 1 to 3 of 3

How to create a new graphics object with the same properties as an old graphics object

  1. Default How to create a new graphics object with the same properties as an old graphics object

    I just posted this in VB group and then thought this NG might be more
    appropriate.

    I have an image and a graphics object created (FromImage) from that image.

    I need to create a new image and create a new graphics object from the new
    image.

    I want the new graphics object have all the same property values as the old
    graphics object (like PageUnit and InterpolationMode...)

    Can I do that without setting them all one at a time?



    Thanks




  2. Default Re: How to create a new graphics object with the same propertiesas an old graphics object

    Hmmmm, I haven't tried this but you could try to save a graphics
    container from one Graphics object and load it into the second...

    --
    Bob Powell [MVP]
    Visual C#, System.Drawing

    Ramuseco Limited .NET consulting
    http://www.ramuseco.com

    Find great Windows Forms articles in Windows Forms Tips and Tricks
    http://www.bobpowell.net/tipstricks.htm

    Answer those GDI+ questions with the GDI+ FAQ
    http://www.bobpowell.net/faqmain.htm

    All new articles provide code in C# and VB.NET.
    Subscribe to the RSS feeds provided and never miss a new article.





    active wrote:
    > I just posted this in VB group and then thought this NG might be more
    > appropriate.
    >
    > I have an image and a graphics object created (FromImage) from that image.
    >
    > I need to create a new image and create a new graphics object from the new
    > image.
    >
    > I want the new graphics object have all the same property values as the old
    > graphics object (like PageUnit and InterpolationMode...)
    >
    > Can I do that without setting them all one at a time?
    >
    >
    >
    > Thanks
    >
    >
    >


  3. Default Re: How to create a new graphics object with the same properties as an old graphics object

    I expected I'd be posting to say how easily it solved my problem.

    But I did the following

    Dim gs As GraphicsState = mPicGraphics.Save

    NewSizeBitmapGraphics.Restore(gs)

    Before the statements were run the interpolation method of mPicGraphics was
    NearestNeighbor while NewSizeBitmapGraphics was Bilinear(3).

    After the statements were run they were unchanged.



    Anything else I can try?

    Thanks



    "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
    news:udv6EflgHHA.4872@TK2MSFTNGP03.phx.gbl...
    > Hmmmm, I haven't tried this but you could try to save a graphics container
    > from one Graphics object and load it into the second...
    >
    > --
    > Bob Powell [MVP]
    > Visual C#, System.Drawing
    >
    > Ramuseco Limited .NET consulting
    > http://www.ramuseco.com
    >
    > Find great Windows Forms articles in Windows Forms Tips and Tricks
    > http://www.bobpowell.net/tipstricks.htm
    >
    > Answer those GDI+ questions with the GDI+ FAQ
    > http://www.bobpowell.net/faqmain.htm
    >
    > All new articles provide code in C# and VB.NET.
    > Subscribe to the RSS feeds provided and never miss a new article.
    >
    >
    >
    >
    >
    > active wrote:
    >> I just posted this in VB group and then thought this NG might be more
    >> appropriate.
    >>
    >> I have an image and a graphics object created (FromImage) from that
    >> image.
    >>
    >> I need to create a new image and create a new graphics object from the
    >> new
    >> image.
    >>
    >> I want the new graphics object have all the same property values as the
    >> old graphics object (like PageUnit and InterpolationMode...)
    >>
    >> Can I do that without setting them all one at a time?
    >>
    >>
    >>
    >> Thanks
    >>
    >>



+ Reply to Thread

Similar Threads

  1. Create BITMAP graphics with same properties of the PRINTER graphics
    By Application Development in forum DOTNET
    Replies: 6
    Last Post: 10-24-2007, 08:25 AM
  2. How to move a graphics object
    By Application Development in forum DOTNET
    Replies: 4
    Last Post: 05-18-2007, 08:56 AM
  3. Material properties for object graphics
    By Application Development in forum Idl-pvwave
    Replies: 3
    Last Post: 03-14-2007, 06:15 PM
  4. Replies: 1
    Last Post: 08-02-2006, 01:42 PM
  5. Create windowsless Graphics object
    By Application Development in forum DOTNET
    Replies: 4
    Last Post: 11-15-2005, 12:06 PM