|
-
May 15th, 2004, 05:04 PM
#1
Thread Starter
Fanatic Member
[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)!
-
May 15th, 2004, 05:38 PM
#2
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|