1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-21 16:55:01 -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:
Raymond 2009-11-02 09:25:49 +00:00
parent 79d5a5c5e5
commit 6936a5c81e
4 changed files with 10 additions and 9 deletions

View File

@ -443,7 +443,7 @@ begin
if(PageControl1.PageCount > 1)then
Self.DeleteTab(PageControl1.TabIndex,false)
else
Self.ClearScript;
Self.ClearScript; //DeleteTab would take care of this already, but yeah, it's neater this way.
end;
procedure TForm1.ActionClearDebugExecute(Sender: TObject);

View File

@ -133,7 +133,7 @@ end;
procedure ps_CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer);
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;
function FindBitmap(Bitmap: integer; var x, y: Integer): Boolean;

View File

@ -59,7 +59,7 @@ type
procedure FastDrawClear(Color : TColor);
procedure FastDrawTransparent(x, y: Integer; TargetBitmap: TMufasaBitmap);
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 Desaturate;overload;
procedure Desaturate(TargetBitmap : TMufasaBitmap); overload;
@ -471,12 +471,15 @@ begin
FData[i] := NewCol;
end;
procedure TMufasaBitmap.CopyClientToBitmap(MWindow : TObject; xs, ys, xe, ye: Integer);
procedure TMufasaBitmap.CopyClientToBitmap(MWindow : TObject;Resize : boolean; xs, ys, xe, ye: Integer);
var
wi,hi,y : integer;
y : integer;
wi,hi : integer;
PtrRet : TRetData;
Rows : integer;
begin
if Resize then
Self.SetSize(xe-xs+1,ye-ys+1);
wi := Min(xe-xs + 1,Self.w);
hi := Min(ye-ys + 1,Self.h);
PtrRet := TMWindow(MWindow).ReturnData(xs,ys,wi,hi);

View File

@ -652,10 +652,8 @@ begin
hh := h;
bmp := TMufasaBitmap.Create;
bmp.SetSize(ww - atX, hh - atY);
bmp.OnDestroy:=nil;
bmp.CopyClientToBitmap(TClient(Client).MWindow, atX, atY, ww, hh);
// 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);
n := ExtractText(bmp.FData, bmp.Width, bmp.Height);
Result := ocrDetect(n, bmp.Width, bmp.Height, OCRData[0]);