CompareBitmaps -1 question

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
sfurneaux
Newbie
Posts: 9
Joined: Sat May 09, 2009 2:18 pm

CompareBitmaps -1 question

Post by sfurneaux » Sat May 09, 2009 5:30 pm

Hi all,

Is there any other explanation for a return of -1 in CompareBitmaps?

I am taking a ScreenCapture of a small part of the screen using:

ScreenCapture>61,900,122,947,c:\check_test.bmp


I then debug a script that contains:

ScreenCapture>61,900,122,947,c:\test.bmp
CompareBitmaps>c:\test.bmp,c:\check_test.bmp
If>match>50,OK
...

and the debug window returns a

CHECK_TEST.BMP=-1


The help file states: "If the two files are not of the same dimension then result will be -1. " but looking at the file properties ->summary confirms that the files are identical (and a 400% zoom in Paint looks identical).

Is there any other situation that returns a -1 ?

Thanks for your help.

sfurneaux
Newbie
Posts: 9
Joined: Sat May 09, 2009 2:18 pm

Post by sfurneaux » Sat May 09, 2009 6:02 pm

In fact, I made it simpler and just debugged:

ScreenCapture>61,900,122,947,c:\check_test.bmp
ScreenCapture>61,900,122,947,c:\test.bmp
CompareBitmaps>c:\test.bmp,c:\check_test.bmp

and it still fails with a -1 :?

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Add third param.

Post by gdyvig » Sat May 09, 2009 6:36 pm

You forgot the last param.
-1 also returned for syntax errors.

CompareBitmaps>c:\test.bmp,c:\check_test.bmp ,match

Gale

sfurneaux
Newbie
Posts: 9
Joined: Sat May 09, 2009 2:18 pm

Post by sfurneaux » Sat May 09, 2009 8:05 pm

I am such a muppet! :oops:

Thanks, gdyvig, that's definitely going into my notepad: "-1 also returned for syntax errors."

All is well again (love this forum!)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts