Join Multiple Images IN FMX?

  

In VCL this is how i make a single image from two images while creating space between them:

procedure TForm2.Button1Click(Sender: TObject);
var
p1,p2:string;
b1,b2:TBitmap;
bitmap: TBitmap;
begin
p1:=’C:\Users\John\Desktop\p1.bmp’;
p2:=’C:\Users\John\Desktop\p2.bmp’;
b1:=TBitmap.Create;
b1.LoadFromFile(p1);
b2:=TBitmap.Create;
b2.LoadFromFile(p2);
sBit:= TBitmap.Create;
try
sBit.Height:=b1.Height;
sBit.Width:=b1.Width+5+b2.Width;
sBit.Canvas.Draw(0,0,b1); //Drawing First Bitamp here
sBit.Canvas.Draw(b1.Width + 5,0,b2);// Drawing Second one
Image1.Picture.Bitmap.Assign(sBit);
finally
sBit.FreeImage;
end;
end;

Now How Can i draw the same in FMX ?

EDIT

Using Bitmap.CopyFromBitmap Works!!

procedure process;
var
p1,p2: String;
b1,b2,b3:TBitmaps;
rect: TRect;
begin
//load both bitmaps to b1 and b2.
rect.Left:=0;
rect.Top:=0;
rect.Width:=b1.Width;
rect.Height:=b1.Height;
b3:= TBitmaps.Create;
b3.Height:= b1.height;
b3.widht:=b1.width;
b3.CopyFromBitmap(b1,rect,0,0);
b3.CopyFromBitmap(b2,rect,b1r.Width+5,0);
Image1.Bitmap.Assign(b3);
end;

Comments are closed.