mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-22 17:22:21 -05:00
Added CopyClientToBitmap in MBitmaps.
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@69 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
60cb8a6d8b
commit
a8c09d2149
@ -4,7 +4,7 @@ unit bitmaps;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FPImgCanv,FPImage,IntfGraphics,graphtype,MufasaTypes ,graphics;
|
Classes, SysUtils, FPImgCanv,FPImage,IntfGraphics,graphtype,MufasaTypes,window,graphics;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -33,6 +33,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 : TMWindow; xs, ys, xe, ye: Integer);
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy;override;
|
destructor Destroy;override;
|
||||||
end;
|
end;
|
||||||
@ -404,6 +405,22 @@ begin
|
|||||||
FData[i] := NewCol;
|
FData[i] := NewCol;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMufasaBitmap.CopyClientToBitmap(MWindow : TMWindow; xs, ys, xe, ye: Integer);
|
||||||
|
var
|
||||||
|
wi,hi,y : integer;
|
||||||
|
PtrRet : TRetData;
|
||||||
|
Rows : integer;
|
||||||
|
begin
|
||||||
|
Self.ValidatePoint(xs,ys);
|
||||||
|
Self.ValidatePoint(xe,ye);
|
||||||
|
wi := xe-xs + 1;
|
||||||
|
hi := ye-ys + 1;
|
||||||
|
PtrRet := MWindow.ReturnData(xs,ys,wi,hi);
|
||||||
|
for y := 0 to (hi-1) do
|
||||||
|
Move(PtrRet.Ptr[y * (wi + PtrRet.IncPtrWith)], FData[y * self.w],wi * SizeOf(TRGB32));
|
||||||
|
MWindow.FreeReturnData;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TMBitmaps.Create(Owner: TObject);
|
constructor TMBitmaps.Create(Owner: TObject);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
@ -303,6 +303,7 @@ begin
|
|||||||
PtrReturn := Self.ReturnData(0,0,w,h);
|
PtrReturn := Self.ReturnData(0,0,w,h);
|
||||||
GetMem(Self.FrozenData, w * h * sizeof(TRGB32));
|
GetMem(Self.FrozenData, w * h * sizeof(TRGB32));
|
||||||
Move(PtrReturn.Ptr[0], FrozenData[0], w*h*sizeof(TRGB32));
|
Move(PtrReturn.Ptr[0], FrozenData[0], w*h*sizeof(TRGB32));
|
||||||
|
Self.FreeReturnData;
|
||||||
Self.FreezeState:=True;
|
Self.FreezeState:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user