mirror of
https://github.com/moparisthebest/Simba
synced 2025-02-16 07:10:10 -05:00
Made some changes in CopyClientToBitmap (It does NOT have a bug, unless ReturnData is wrong.. Might wanne look into that Tovenaar) it now has the option to resize the bitmap or not. (Scar does resize the bitmap).
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@174 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
79d5a5c5e5
commit
6936a5c81e
@ -443,7 +443,7 @@ begin
|
|||||||
if(PageControl1.PageCount > 1)then
|
if(PageControl1.PageCount > 1)then
|
||||||
Self.DeleteTab(PageControl1.TabIndex,false)
|
Self.DeleteTab(PageControl1.TabIndex,false)
|
||||||
else
|
else
|
||||||
Self.ClearScript;
|
Self.ClearScript; //DeleteTab would take care of this already, but yeah, it's neater this way.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.ActionClearDebugExecute(Sender: TObject);
|
procedure TForm1.ActionClearDebugExecute(Sender: TObject);
|
||||||
|
@ -133,7 +133,7 @@ end;
|
|||||||
|
|
||||||
procedure ps_CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer);
|
procedure ps_CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer);
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps.GetBMP(bmp).CopyClientToBitmap(CurrThread.Client.MWindow, xs, ys, xe, ye);
|
CurrThread.Client.MBitmaps.GetBMP(bmp).CopyClientToBitmap(CurrThread.Client.MWindow, True, xs, ys, xe, ye);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindBitmap(Bitmap: integer; var x, y: Integer): Boolean;
|
function FindBitmap(Bitmap: integer; var x, y: Integer): Boolean;
|
||||||
|
@ -59,7 +59,7 @@ type
|
|||||||
procedure FastDrawClear(Color : TColor);
|
procedure FastDrawClear(Color : TColor);
|
||||||
procedure FastDrawTransparent(x, y: Integer; TargetBitmap: TMufasaBitmap);
|
procedure FastDrawTransparent(x, y: Integer; TargetBitmap: TMufasaBitmap);
|
||||||
procedure FastReplaceColor(OldColor, NewColor: TColor);
|
procedure FastReplaceColor(OldColor, NewColor: TColor);
|
||||||
procedure CopyClientToBitmap(MWindow : TObject; xs, ys, xe, ye: Integer);
|
procedure CopyClientToBitmap(MWindow : TObject;Resize : boolean; xs, ys, xe, ye: Integer);
|
||||||
procedure RotateBitmap(angle: Extended;TargetBitmap : TMufasaBitmap );
|
procedure RotateBitmap(angle: Extended;TargetBitmap : TMufasaBitmap );
|
||||||
procedure Desaturate;overload;
|
procedure Desaturate;overload;
|
||||||
procedure Desaturate(TargetBitmap : TMufasaBitmap); overload;
|
procedure Desaturate(TargetBitmap : TMufasaBitmap); overload;
|
||||||
@ -471,12 +471,15 @@ begin
|
|||||||
FData[i] := NewCol;
|
FData[i] := NewCol;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMufasaBitmap.CopyClientToBitmap(MWindow : TObject; xs, ys, xe, ye: Integer);
|
procedure TMufasaBitmap.CopyClientToBitmap(MWindow : TObject;Resize : boolean; xs, ys, xe, ye: Integer);
|
||||||
var
|
var
|
||||||
wi,hi,y : integer;
|
y : integer;
|
||||||
|
wi,hi : integer;
|
||||||
PtrRet : TRetData;
|
PtrRet : TRetData;
|
||||||
Rows : integer;
|
Rows : integer;
|
||||||
begin
|
begin
|
||||||
|
if Resize then
|
||||||
|
Self.SetSize(xe-xs+1,ye-ys+1);
|
||||||
wi := Min(xe-xs + 1,Self.w);
|
wi := Min(xe-xs + 1,Self.w);
|
||||||
hi := Min(ye-ys + 1,Self.h);
|
hi := Min(ye-ys + 1,Self.h);
|
||||||
PtrRet := TMWindow(MWindow).ReturnData(xs,ys,wi,hi);
|
PtrRet := TMWindow(MWindow).ReturnData(xs,ys,wi,hi);
|
||||||
|
@ -652,10 +652,8 @@ begin
|
|||||||
hh := h;
|
hh := h;
|
||||||
|
|
||||||
bmp := TMufasaBitmap.Create;
|
bmp := TMufasaBitmap.Create;
|
||||||
bmp.SetSize(ww - atX, hh - atY);
|
// bmp.SetSize(ww - atX, hh - atY); CopyCLientToBitmap will automatically resize -> Resize bool is true.
|
||||||
bmp.OnDestroy:=nil;
|
bmp.CopyClientToBitmap(TClient(Client).MWindow,True, atX, atY, atX + ww, atY + hh);
|
||||||
|
|
||||||
bmp.CopyClientToBitmap(TClient(Client).MWindow, atX, atY, ww, hh);
|
|
||||||
|
|
||||||
n := ExtractText(bmp.FData, bmp.Width, bmp.Height);
|
n := ExtractText(bmp.FData, bmp.Width, bmp.Height);
|
||||||
Result := ocrDetect(n, bmp.Width, bmp.Height, OCRData[0]);
|
Result := ocrDetect(n, bmp.Width, bmp.Height, OCRData[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user