Groups | Blog | Home
all groups > dotnet drawing api > march 2004 >

dotnet drawing api : Can you draw directly to the screen?


scottfoley NO[at]SPAM bigfoot.com
3/25/2004 8:23:54 AM
Is it possible to draw over an existing image without redisplaying the
entire image each time? I am using a PictureBox Form, but could
change that if needed. Right now I read in what is currently there,
add to it, and then redisplay it like this:

Bitmap objBitmap = new Bitmap(pictureBox1.Image);
// Add to the image
pictureBox1.Image = objBitmap;

For assumed speed reasons I would like to simply draw directly onto
the PictureBox. Is this possible, and would it be noticeably faster?

Thanks,
Bob Powell [MVP]
3/25/2004 10:59:42 PM
You can draw using the PictureBox Paint event.

Check out http://www.bobpowell.net/creategraphics.htm for other details.

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

Check out February's edition of Well Formed.
Non-client drawing, Graphics Transform stack and Flood-Filling
http://www.bobpowell.net/currentissue.htm

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

Read my Blog at http://bobpowelldotnet.blogspot.com

[quoted text, click to view]

AddThis Social Bookmark Button