Noch eine Möglichkeit, mit
pmNotXor kann seine gezeichnete Linie wieder löschen.
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin//Kreuz Zeichnen
Image1.Picture.Bitmap.Canvas.Pen.Mode:= pmNotXor;
Image1.Picture.Bitmap.Canvas.MoveTo(0, 16);
Image1.Picture.Bitmap.Canvas.LineTo(32, 16);
Image1.Picture.Bitmap.Canvas.MoveTo(16, 0);
Image1.Picture.Bitmap.Canvas.LineTo(16, 32);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin//Kreuz wieder löschen
Image1.Picture.Bitmap.Canvas.Pen.Mode:= pmNotXor;
Image1.Picture.Bitmap.Canvas.MoveTo(0, 16);
Image1.Picture.Bitmap.Canvas.LineTo(32, 16);
Image1.Picture.Bitmap.Canvas.MoveTo(16, 0);
Image1.Picture.Bitmap.Canvas.LineTo(16, 32);
end;