SRL Archive - Help and Support

SetTargetBitmap related help needed...


Cruel

2006-06-28 22:17:58

I'm working on an important plugin for SCAR and it's dependant on all searching procedures being run on a bitmap (hence the usage of SetTargetBitmap).
However, the OCR functions (like IsTextAtEx) don't seem to work on it. I just need this to be confirmed… do these functions need to be ran on a client window?

The Un-Named

2006-06-29 01:40:02

Bitmap finding and text finding need to have the client activated, I'm 100% sure on bitmaps.

Cruel

2006-06-29 02:50:35

Well.. this is what the SCAR manual says:
procedure SetTargetBitmap(bitmap: Integer); - Sets bitmap as target for all color/bitmap searching functions. After calling SetTargetBitmap all functions won't be working with client but with specified bitmap.
Example:
SetTargetBitmap(flagstaff);
if(FindColor(x, y, $000066, 0, 0, 3, 2))then
…
The sample above will not search on client screen but in bitmap "flagstaff" instead.

Just says it works for color/bitmap searching functions.
Therefore, I'm gonna assume it won't work for DTM, OCR, and other such functions.
That sucks… and unless anyone has any bright ideas as to getting those functions to work on a bitmap, I'm just gonna have to do some "h4xx0riz1ng" to fix it… lol

Renax

2006-06-29 11:26:08

isn't the OCR based on bitmapmasks ? so in theory a


FindBitmapMaskTolerance(CreatebitmapMaskFromText('blah', UpChars, x, y, x1, y1, x2, y2, 10, 50)

should work

Cruel

2006-06-29 12:08:51

Good idea :)
I wasn't aware of that function.

Although it'd still remove the usage of some IsTextAtEx parameters such as min and max spacing… and shadow checking and such.
But thanks, I'll work with it a bit. :D

Renax

2006-06-29 14:21:41

<3 CreateBitmapMaskFromText :)

Bebe

2006-06-29 14:26:21

Renax your wrong :p

it's:


c:=CreatebitmapMaskFromText('blah', UpChars)
FindBitmapMaskTolerance(c, x, y, x1, y1, x2, y2, 10, 50)

Renax

2006-06-30 10:04:22

you can call CreateBitmapMaskFRomText, from within FindBitmapMaskTolerance and negate a variable, and you wouldn't have to free that variable either :)

Bebe

2006-06-30 12:22:08

I know you can, but this also causes memory leaks, and we don't want those :p