Einzelnen Beitrag anzeigen

Benutzerbild von ATS3788
ATS3788

Registriert seit: 18. Mär 2004
Ort: Kriftel
646 Beiträge
 
Delphi XE Starter
 
#5

AW: gdi+ 2 TGPBitmap zu einer zusammenfügen

  Alt 16. Feb 2012, 10:34
Delphi-Quellcode:
var
B1 , B2, B3 : TBitmap;
i,x,y : integer;
begin

B1 := TBitmap.Create;
B2 := TBitmap.Create;
B3 := TBitmap.Create;

B1.LoadFromFile('d:\test1.bmp');
B2.LoadFromFile('d:\testX.bmp');


B3.Height := B1.Height + B2.Height;
B3.Width := B1.Width;

for x := 0 to B3.Width -1 do
for y := 0 to B3.Height -1 do begin

if y <= B1.Height then
B3.Canvas.Pixels [x , y ] := B1.Canvas.Pixels [x , y ]
else
B3.Canvas.Pixels [x , y ] := B2.Canvas.Pixels [x , y - B1.Height -1 ];

end;

B3.SaveToFile('d:\testQ.bmp');

 Image2.Picture.Bitmap.Assign(B3);

 B1.Free;
 B2.Free;
 B3.Free;

end;
Habe da mal was zusammengebastelt, aber es geht
auf die Idee hat mich die Seite
http://www.davdata.nl/math/bmresize.html
gebracht. Mal sehen ob ich das noch schneller mit streams bekomme
Martin MIchael
  Mit Zitat antworten Zitat