how can i clear the image in a picturebox to draw a new image.
its working.but there have no chance to draw a image without the form load
2009-09-11 06:33:08
+1
A:
Create a new Bitmap object with the value of width and height.
PictureBox1.Image = New Bitmap(100, 100)
adatapost
2009-09-11 06:36:28
+2
A:
Suppose you have two buttons on the interface to clear the image and redraw image, you can use following functions on their click handlers.
VB
Private Sub ClearImage()
PictureBox1.Image = Nothing
End Sub
Private Sub SetImage(ByVal img As Image)
PictureBox1.Image = img
End Sub
C#
public void ClearImage()
{
PictureBox1.Image = null;
}
public void SetImage( Image img)
{
PictureBox1.Image = img;
}
Mahin
2009-09-11 06:41:19