Solved

Picturebox image comparison with resource image

Posted on 2008-10-29
1
1,097 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
Search an image for an image 3 30
VB.NET 2008 Publish Error 2 27
Expression Evaluater 3 26
What Does This C# Code Block Do? 5 30
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 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