Hello , please can someone helps me porting this VCL procedure into FMX :
procedure AssignBmp(SrcBmp,DstBmp:TBitmap);
var
_pxlSize : integer;
begin
if (SrcBmp.Width * SrcBmp.Height) = 0 then Exit;
// 0 size
case SrcBmp.PixelFormat of
pf8bit: _pxlSize := 1;
pf16bit: _pxlSize := 2;
pf24bit: _pxlSize := 3;
pf32bit: _pxlSize := 4;
else
raise Exception.Create('AssignBmp Error : Unknown PixelFormat .');
end;
try
if SrcBmp.PixelFormat <> DstBmp.PixelFormat
then
// assign the source bitmap pix-format to the target bitmap
DstBmp.PixelFormat := SrcBmp.PixelFormat;
if SrcBmp.Width <> DstBmp.Width
then
// assign the source bitmap width to the target bitmap width
DstBmp.Width := SrcBmp.Width;
if SrcBmp.Height <> DstBmp.Height
then
DstBmp.Height := SrcBmp.Height;
// copy the source bitmap to the target one
Move(
SrcBmp.ScanLine[SrcBmp.Height-1]^,
DstBmp.ScanLine[DstBmp.Height-1]^,
SrcBmp.Width * SrcBmp.Height * _pxlSize
);
except
on E : Exception do raise Exception.Create('AssignBmp Error : ' + E.Message );
end;
so many thanks .