View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_6_] Peter T[_6_] is offline
external usenet poster
 
Posts: 2
Default Comparing images?

It's a while since I've looked at this but to point you in the right
direction probably need to convert the stdPicture (in effect same as
IPictureDisp albeit class not an interface) to a byte array. With those
search terms (stdPicture rather than IPictureDisp) you should find some API
examples. Having got a pair of byte arrays it should be straightforward to
compare them in a simple loop, starting with their size (ie ubound) which
should be the same.

Regards,
Peter T


"Charlotte E." wrote in message
...
Hi Guys,

I think, I have a tricky one this time :-)


I have two images, both 16 x 16 pixels = 256 pixels total.
They are both in an 'IPictureDisp' object variable - and I really don't
know that much about the 'IPictureDisp' object, which I have just started
to explore...

Is there any way to compare these two images, pixel by pixel, to test if
each pixel has the same color (RGB), and thus, if the pixels are all the
same, it is the same picture?

To test if two pictures are the same, as you can with other VB variables,
i.e. If MyVar1 = MyVar2 Then...

Sort of If MyPic1 = MyPic2 Then...

Any idea to acomplish a test, if two pictures are the same???


Thanks,

CE



---
Denne e-mail er fri for virus og malware fordi avast! Antivirus
beskyttelse er aktiveret.
http://www.avast.com