Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Comparing images?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Comparing images?

Thanks, Peter - got it working :-)

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

Thanks...

CE


"Peter T" wrote in message
...
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






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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart.Export images are shrinking as I export more images Jared Charts and Charting in Excel 3 January 29th 08 03:23 AM
Images Francis Ang[_3_] Excel Programming 1 March 2nd 07 02:06 AM
Transformation d'images avec une extension .jpg ou .jpeg en images avec extension .bmp ou .ico imej-clavier Excel Discussion (Misc queries) 1 May 28th 05 05:52 PM
Images Ren Excel Programming 1 January 27th 05 07:47 PM
*.gif images Mischa Browne[_2_] Excel Programming 4 July 16th 04 03:18 PM


All times are GMT +1. The time now is 09:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"