1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-08-13 16:53:59 -04:00

Few changes - not done yet.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@178 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2009-11-02 11:35:53 +00:00
parent c3aa2b3e36
commit cee2bb4d82
2 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
function rs_GetUpText: String;
begin
Result := CurrThread.Client.MOCR.GetUpTextAt(9,9);
Result := CurrThread.Client.MOCR.GetUpTextAt(7,7);
end;

View File

@ -469,6 +469,12 @@ var
begin
RGBtoXYZ(c,X,Y,Z);
sum:= X + Y + Z;
if(sum = 0) then
begin
result.l := 0.0;
result.a := 0.0;
result.b := 0.0;
end;
Xn:= X / sum;
Yn:= Y / sum;
Zn:= Z / sum;
@ -484,7 +490,7 @@ end;
function ExtractText(colors: PRGB32;{colors: tRGBArray;} w,h: integer): TNormArray;
const
GradientMax = 5.0;
GradientMax = 2.0;
white: tRGB = ( b: $FF; g: $FF; r: $FF; a: $00 );
cyan: tRGB = ( b: $FF; g: $FF; r: $00; a: $00 );
yellow: tRGB = ( b: $00; g: $EF; r: $FF; a: $00 );
@ -643,7 +649,7 @@ var
begin
TClient(Client).MWindow.GetDimensions(w, h);
ww := 300;
ww := 200;
hh := 20;
if ww + atX > w then
@ -653,12 +659,14 @@ begin
bmp := TMufasaBitmap.Create;
// bmp.SetSize(ww - atX, hh - atY); CopyCLientToBitmap will automatically resize -> Resize bool is true.
bmp.CopyClientToBitmap(TClient(Client).MWindow,True, atX, atY, atX + ww, atY + hh);
bmp.CopyClientToBitmap(TClient(Client).MWindow,True, atX, atY, atX + ww - 1, atY + hh - 1);
writeln(inttostr(bmp.Width) + ', ' + inttostr(bmp.height));
bmp.SaveToFile('/tmp/output.bmp');
n := ExtractText(bmp.FData, bmp.Width, bmp.Height);
Result := ocrDetect(n, bmp.Width, bmp.Height, OCRData[0]);
bmp.SaveToFile('/tmp/output.bmp');
bmp.Free;
end;