1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
//vueImg :TImageViewer
//Bmp,Bmp2 :TBitmap
procedure TFTest.dessine;
var
SrcRect, DstRect: TRectF;
BmpWrk: TBitmap;
i: Integer;
begin
BmpWrk:=TBitmap.Create;
Bmp2.LoadFromFile('pion1.png');
BmpFond.LoadFromFile('carte.png');
Bmp.Assign(BmpFond);
Bmp.Canvas.BeginScene;
for i := 0 to 5 do
begin
BmpWrk.Assign(Bmp2);
BmpWrk.Rotate(45);
SrcRect.Left := 0;
SrcRect.Top := 0;
SrcRect.Width := BmpWrk.Width;
SrcRect.Height := BmpWrk.Height;
DstRect.Left := 500 + 100 * i;
DstRect.Top := 250;
DstRect.Width := BmpWrk.Width;
DstRect.Height := BmpWrk.Height;
Bmp.Canvas.DrawBitmap(BmpWrk, SrcRect, DstRect, 1, true);
end;
Bmp.Canvas.EndScene;
vueImg.Bitmap.Assign(Bmp);
BmpWrk.Free;
end; |
Partager