Bonjour à tous,
je voudrais savoir s' il existe une méthode plus performante pour copier une partie d' un TGraphic vers un Canvas.
Pour l' instant, je passe par un TBitmap que je crée dynamiquement:
if (MaxWidth <> aBgPicture.Picture.Width) or ((MaxHeight <> aBgPicture.Picture.Height))
then begin
// Copy part of the image :
TmpBmp := TBitmap.Create;
// Try converting into bitmap
TmpBmp.Width := MaxWidth;
TmpBmp.Height := MaxHeight;
TmpBmp.PixelFormat := pf32bit;
aBgPicture.Picture.Graphic.Transparent := false;
TmpBmp.Canvas.Draw(0, 0, aBgPicture.Picture.Graphic);
TmpBmp.Transparent := aBgPicture.Transparent;
aCanvas.Draw(x, y, TmpBmp);
TmpBmp.Free;
end
else
aCanvas.Draw(x, y, aBgPicture.Picture.Graphic);
Merci,
Maurício