Solved

Picturebox image comparison with resource image

Posted on 2008-10-29
1
1,095 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with solving error related to resources file 4 36
How can I use SQL Stored Procedure to return FedEx Zone 17 42
Runtime Error 2 29
Web Form VB.Net  import CSV 4 27
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now