0

I need to find out what is currently hold in PictureBox.Image property and take action as necessary. I tried various things but can't get it work

Compare it with PictureBox which Image is set to null

PictureBox emptyImg = new PictureBox();
emptyImg.Image = null;

//Compare
myPictureBox.Image.Equals((Bitmap) emptyImg.Image)

Compare with existing resources

myPictureBox.Image.Equals((Bitmap) Properties.Resources.blue)

Project builds without any errors but once I run form its kicks meaningless errors.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by peter_budo
0

I have tried that once but with images in the same picturebox is what i comapared and it worked,
but when i did it with 2 images in different picture boxes, as far as i remember the later didn't work for me either

0

I just got solution from friend

System.Object.Equals((Bitmap)myPictureBox.Image,(Bitmap)emptyImg.Image)

Problem sorted...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.