blank System.Drawing.Image

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

How would you go about creating a blank System.Drawing.Image object
(i.e. an image with just a white backcolour)?
 
How would you go about creating a blank System.Drawing.Image object
(i.e. an image with just a white backcolour)?

Just create a Bitmap instance. You can use the Graphics.Clear() method to
clear it to a single color.

The alternative Image implementation is Metafile. Once you created one,
you can initialize it in the same way, but my recollection is that
creating a Metafile in .NET is not nearly as simple as creating a Bitmap
(it's been a few years, but I know I've written code to do it).

Pete
 
Back
Top