Testing for current PictureBox.Image
-
I am setting a PictureBox.Image to an ImageList index with summaryKeyEventsPictureBox.Image = keyEventIconsImageList.Images[2]; If I wanted to test if my current pictureBox image was equal to the ImageList.Images[2] how would I do this please?
-
I am setting a PictureBox.Image to an ImageList index with summaryKeyEventsPictureBox.Image = keyEventIconsImageList.Images[2]; If I wanted to test if my current pictureBox image was equal to the ImageList.Images[2] how would I do this please?
There's no equals operator for images. The most effective way, is to store the index somewhere. Does the picturebox have a Tag property ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
I am setting a PictureBox.Image to an ImageList index with summaryKeyEventsPictureBox.Image = keyEventIconsImageList.Images[2]; If I wanted to test if my current pictureBox image was equal to the ImageList.Images[2] how would I do this please?
-
Hi, check this..[^] may it helps you :-O
Thanks, Sun Rays To get something you must have to try once. My Articles
This is pretty close to being totally unrelated to his question
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
This is pretty close to being totally unrelated to his question
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
He meant well. Anyway, my grateful thanks for all the replies.
-
I am setting a PictureBox.Image to an ImageList index with summaryKeyEventsPictureBox.Image = keyEventIconsImageList.Images[2]; If I wanted to test if my current pictureBox image was equal to the ImageList.Images[2] how would I do this please?
As an addendum to what CG was saying you could also save them to MemoryStreams and hash them. From there, it's a simple matter of comparing the byte arrays. I wouldn't personally use this method, I'm just including it for completeness' sake. I would do as CG said, and try to use the PictureBox's Tag property
Between the idea And the reality Between the motion And the act Falls the Shadow
-
This is pretty close to being totally unrelated to his question
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
ROTFL :laugh:
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.