Solved

Picturebox image comparison with resource image

Posted on 2008-10-29
1
1,110 Views
Last Modified: 2008-11-09
Hi,
I need to compare an embeded resource image, with the image in a picutre box, in order to determine what image is showing.
Something in the line of:

  if (picStatus.Image == TouchScreenLibrary.Properties.Resources.gears)
 {
        picStatus.Image = TouchScreenLibrary.Properties.Resources.gears_view;
 }

The above code does work however, how can I change it in order to do the comparison ?
0
Comment
Question by:wilcosw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
mac-will earned 250 total points
ID: 22858012
Not pretty, but this might work.
MemoryStream ms = new MemoryStream();
picStatus.Save(ms,System.Drawing.Imaging.ImageFormat.Jpeg);
 
MemoryStream ms2 = new MemoryStream();
gears.Save(ms2,System.Drawing.Imaging.ImageFormat.Jpeg);
 
if(ms.ToArray() == ms2.ToArray())

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question