Solved

Picturebox image comparison with resource image

Posted on 2008-10-29
1
1,090 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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

11 Experts available now in Live!

Get 1:1 Help Now