Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clearing the image in a picturebox

Tags:

vb.net

I have a form with a picturebox that will allow to draw a free hand picture.

I added the initialization of the image in the form_load and the click event of the clear button. When I click the clear button the image is cleared and at the mouse move on the picturebox the last drawned image will shown.

My question is, how can I validate the picturebox whether it is empty or not? Just that I don't want to permit to save an empty image.

like image 491
user85511 Avatar asked Sep 10 '09 06:09

user85511


2 Answers

PictureBox1.Image = Nothing
like image 175
KV Prajapati Avatar answered Oct 14 '22 05:10

KV Prajapati


Private Sub ClearPictureBox(pb As PictureBox)
    pb.Image = Nothing
    pb.BackColor = Color.Empty
    pb.Invalidate()
End Sub
like image 22
Crouchie Avatar answered Oct 14 '22 06:10

Crouchie