Jump to content
seafight17

function CreateBitmapMaskFromText(Text: AnsiString; Chars: Integer): TSCARBitmap;

Recommended Posts

hallo the function >

function CreateBitmapMaskFromText(Text: AnsiString; Chars: Integer): TSCARBitmap;

what actially do? it we a text and ma ke the mask of it? and in cas the text is with bold..or underline ...how it will create.. ex.. in this picture..>>

. 14749306.png

 

Uploaded with ImageShack.us

 

it will show me the bitmap (mask of bitmap) of the "(26)Xafies tou Xalbart " +

if i try to make it using thme mask cretor... then which is the best gunctio to find it easy?

Link to comment
Share on other sites

[scar]

FindBitmapMaskTolerance(Mask: TSCARBitmap; x, y, x1, y1, x2, y2, Tolerance, ContourTolerance: LongInt): Boolean

[/scar]

 

CreateBitmapMaskFromText, uses a FONT SET, OR FONT FAMILY you choose, or from your System.

 

e.g.

 

[sCAR]

Bmp := CreateBitmapMaskFromText('TestText', UpChars);

[/sCAR]

Edited by LordJashin
Link to comment
Share on other sites

I try this function but not detesk tthe mask ... any solousion? (SCAR Divi mask)

>>

[scar]program New;

var x,y,x1,x2,y1,y2 : integer;

var Mask :TSCARBitmap;

 

procedure LoadBMP;

begin

Mask :=BmpFromStrLegacy(61, 17, 'beNrtlEEOgCAMBPk2v+fgBdOy' +

'3RYwMdk5GNvoMlFoa0LU6BNMEz8TJqwcss58CHCwrzC2O5+ad17dM' +

'DlPOV9tv7ZJ/qVNJrjaeG+DcLc8rt0N4aIfa2f/eOpI8ie6MP1sP9' +

'R2SzwAr44aIYR4MQBiDqGn');

 

end;

 

 

procedure Mouse(x, y: Integer);

begin

MouseBtnDown(x, y, mbLeft);

Wait(100);

MouseBtnUp(x, y, mbLeft);

Wait(50);

end;

 

procedure find;

begin

if FindBitmapMaskTolerance(Mask, x, y, x1, y1, x2, y2, 0, 5) then

Mouse(x, y);

writeln('scar divi mask found!!');

end;

 

 

 

begin

LoadBMP;

SetClient(TSCARWindowClient.Create(GetDesktopWindow)).Free;

repeat

find;

until false;

end.

[/scar]

Link to comment
Share on other sites

You are not setting x1,y1,x2,y2 before calling FindBitmapMaskTolerance so it is searching the area (0,0) to (0,0) which I suspect is not what you want.

 

Try this:

 

[sCAR]program New;

 

var

x,y: integer;

B: TBox;

Mask: TSCARBitmap;

 

procedure LoadBMP;

begin

Mask := BmpFromStrLegacy(61, 17, 'beNrtlEEOgCAMBPk2v+fgBdOy' +

'3RYwMdk5GNvoMlFoa0LU6BNMEz8TJqwcss58CHCwrzC2O5+ad17dM' +

'DlPOV9tv7ZJ/qVNJrjaeG+DcLc8rt0N4aIfa2f/eOpI8ie6MP1sP9' +

'R2SzwAr44aIYR4MQBiDqGn');

end;

 

procedure Mouse(x, y: Integer);

begin

MouseBtnDown(x, y, mbLeft);

Wait(100);

MouseBtnUp(x, y, mbLeft);

Wait(50);

end;

 

procedure find;

begin

if FindBitmapMaskTolerance(Mask, x, y, B.x1, B.y1, B.x2, B.y2, 0, 5) then

begin

Mouse(x, y);

writeln('scar divi mask found!!');

end;

end;

 

begin

LoadBMP;

SetClient(TSCARWindowClient.Create(GetDesktopWindow)).Free;

B := GetClient.ImageArea;

repeat

find;

until false;

end.[/sCAR]

 

Edit: What font is that? Would make helping you much easier if we knew.

Edited by Bixby Sayz
Link to comment
Share on other sites

For the font in the OP's (seafight17) post, he/she would need to create his own font set probably. Or use a font set that supports those characters. It might just be Verdana for all I know. Find a font set that has a lot of characters and looks most similar to the text there. Unicode characters.

 

Need to go look up character encoding again, and fonts, used to be an expert at this stuff...

Link to comment
Share on other sites

When i "run" th sript.. it works fine... it detect (find) the "mask" (which is the mask of thw word >>"SCAR") IF i change the mask ..with onother one.. (pisture to string >mask editor) and replace it....The sctript no respond..no detech the new mask .. What i should d to detect it?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...