1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 01:02:17 -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:
Raymond 2009-09-18 05:14:09 +00:00
parent 60cb8a6d8b
commit a8c09d2149
2 changed files with 19 additions and 1 deletions

View File

@ -4,7 +4,7 @@ unit bitmaps;
interface
uses
Classes, SysUtils, FPImgCanv,FPImage,IntfGraphics,graphtype,MufasaTypes ,graphics;
Classes, SysUtils, FPImgCanv,FPImage,IntfGraphics,graphtype,MufasaTypes,window,graphics;
type
@ -33,6 +33,7 @@ type
procedure FastDrawClear(Color : TColor);
procedure FastDrawTransparent(x, y: Integer; TargetBitmap: TMufasaBitmap);
procedure FastReplaceColor(OldColor, NewColor: TColor);
procedure CopyClientToBitmap(MWindow : TMWindow; xs, ys, xe, ye: Integer);
constructor Create;
destructor Destroy;override;
end;
@ -404,6 +405,22 @@ begin
FData[i] := NewCol;
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);
begin
inherited Create;

View File

@ -303,6 +303,7 @@ begin
PtrReturn := Self.ReturnData(0,0,w,h);
GetMem(Self.FrozenData, w * h * sizeof(TRGB32));
Move(PtrReturn.Ptr[0], FrozenData[0], w*h*sizeof(TRGB32));
Self.FreeReturnData;
Self.FreezeState:=True;
end;