Forum Discussion

th6186's avatar
th6186
Occasional Visitor
7 years ago

How to compare image in a WinForms PictureBox to resource?

Hello,

 

an older application in our company often uses PictureBoxes to display small status images (like cross or check).

To check these in our test cases, we would have to somehow compare the image from the DLLs resources with the image displayed in the PictureBox.

 

We tried to use the following code to get the image which gives us a invalid cast:

pictureBox.GetProperty<System.Drawing.Image>("Image");

Unfortunately the image class does not have a Source-Property or anything worth comparing to the resources.

 

Does anyone have a good idea?

 

Best,

Toby

No RepliesBe the first to reply