Comparing images?

C

Charlotte E.

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
 
P

Peter T

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
 
C

Charlotte E.

Thanks, Peter - got it working :)

Didn't quite use the way you mentioned, but it did point me in a right
direction :)

Thanks...

CE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top