How do I clear an Image

  • Thread starter Thread starter active
  • Start date Start date
A

active

In a PictureBox if I want to clear the Image or background do I simply use
FromFile("")
(just a guess)

I did see about FromFile:
If the file does not have a valid image format or if GDI+ does not support
the pixel format of the file, this method throws an OutOfMemoryException
exception.



Search all doc and msdn I could find - looks like nobody has need to clear
an image!





Cal
 
* " active said:
In a PictureBox if I want to clear the Image or background do I simply use
FromFile("")
(just a guess)

I did see about FromFile:
If the file does not have a valid image format or if GDI+ does not support
the pixel format of the file, this method throws an OutOfMemoryException
exception.

\\\
Me.PictureBox1.Image = Nothing
///
 
Should have been my first guess. I'm not into this class/object thing enough
yet.

Thanks
Cal
 
active said:
In a PictureBox if I want to clear the Image or background do I
simply use FromFile("")
(just a guess)

I did see about FromFile:
If the file does not have a valid image format or if GDI+ does not
support the pixel format of the file, this method throws an
OutOfMemoryException exception.



Search all doc and msdn I could find - looks like nobody has need to
clear an image!

You want to clear the image you assigned to the Image property? If yes:
picturebox1.image = nothing

If you want to clear the image you painted in the paint event (or OnPaint):

dim g as graphics
g = picturebox1.creategraphics
g.clear(picturebox1.backcolor)
g.dispose
 
"> You want to clear the image you assigned to the Image property? If yes:
picturebox1.image = nothing
YES


If you want to clear the image you painted in the paint event (or OnPaint):

dim g as graphics
g = picturebox1.creategraphics
g.clear(picturebox1.backcolor)
g.dispose
I'll save this for whenm I need it

Thaks
Cal
 
Back
Top