Results 1 to 2 of 2

Thread: [Resolved]Graphics

  1. #1

    Thread Starter
    Fanatic Member bugzpodder's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    787

    [Resolved]Graphics

    I basically have a Graphics object to a standard Windows Panel. but when it gets covered/minimized, the stuff I've drawn is disappeared. redrawing it is not an option. is there anyway I can take a snap-shot at the panel just before it gets minimized/covered so I can put the snapshot back using the Paint event?
    Last edited by bugzpodder; May 16th, 2004 at 10:40 AM.
    Massey RuleZ! ^-^__Cheers!__^-^ Massey RuleZ!


    Did you know that...
    The probability that a random rational number has an even denominator is 1/3 (Salamin and Gosper 1972)? This result is independently verified by me (2002)!

  2. #2
    Junior Member
    Join Date
    May 2004
    Posts
    24
    You can make your drawing creating a bitmap in memory and draw the bit map in the paint event.


    1 Create a bitmap object

    m_objDrawingSurface= new Bitmap(640, 480,
    System.Drawing.Imaging.PixelFormat.Format24bppRgb);

    2 Put this object in the load event


    3 Initialize your graphics object

    objGraphics = Graphics.FromImage(m_objDrawingSurface);

    4 objGraphics.Clear(SystemColors.Control);

    5 draw on this object




    Lastly on the paint event use the following

    objGraphics = e.Graphics;
    // Draw the contents of the bitmap on the form.
    objGraphics.DrawImage(m_objDrawingSurface, 0,0,
    m_objDrawingSurface.Width,
    m_objDrawingSurface.Height);
    objGraphics.Dispose();


    Hope u get it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width