Hallo, normalerweise benutze ich die TImage-Komponente nicht, weil es auch anders/besser (TPaintBox, nichtvisuelle Bitmap ...) geht.
Mein Tipp mit TImage funktioniert so:
Delphi-Quellcode:
procedure TMainForm.Button2Click(Sender: TObject);
begin
if OpenPictureDialog1.Execute then
Image1.Picture.LoadFromFile(String(OpenPictureDialog1.FileName));
end;
procedure TMainForm.Button3Click(Sender: TObject);
var w,h:Integer;
begin
Image1.Center := TRUE;
Image1.Stretch := TRUE;
Image1.Canvas.Pen.Width := 5;
Image1.Canvas.Pen.Color := clRed;
Image1.Canvas.Brush.Style := bsClear;
//Image1.Canvas.Pen.Style := psSolid;
//Image1.Canvas.Pen.Mode := pmCopy;
w := Image1.Picture.Bitmap.Width;
h := Image1.Picture.Bitmap.Height;
Image1.Canvas.Ellipse(5, 5, w-5, h-5);
end;