Bonjour à tous.

Je cherche à effacer une TImage le plus simplement possible.

Actuellement j'utilise cette procédure :


procedure TForm1.EffaceImage;
var Bitmap: TBitmap;
begin
image1.Canvas
with canvas do
begin
Bitmap := nil;
Bitmap := TBitmap.Create;
Bitmap.Width := image1.width;
Bitmap.Height :=image1.height;
Image1.Picture.Graphic := Bitmap;
Bitmap.Free;
end;
end;


Elle fonctionne mais elle pose un petit problème dans mon projet.

Si vous avez une solution , merci d'avance.