unit Unit2;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
FMX.Controls.Presentation, FMX.StdCtrls, FMX.Objects;
type
TForm2 =
class(TForm)
Image1: TImage;
procedure Image1Click(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,Y: Single);
procedure FormCreate(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
SaveState, InitialState: TCanvasSaveState;
implementation
{$R *.fmx}
procedure TForm2.FormCreate(Sender: TObject);
begin
Image1.Bitmap := TBitmap.CreateFromFile('
Kran.jpg');
InitialState := Image1.Bitmap.Canvas.SaveState;
end;
procedure TForm2.Image1Click(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,Y: Single);
var
AShape: TShape;
TColor: TAlphaColor;
MyRect: TRectF;
x1, y1, x2, y2: integer;
begin
end;
procedure TForm2.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
//funktioniert
var
AShape: TShape;
TColor: TAlphaColor;
MyRect: TRect;
x1, y1, x2, y2: integer;
p: TPointF;
ACursor: TCursor;
begin
begin
p := Screen.MousePos;
Parent := Form2;
x1 := 80;
y1 := 80;
x2 := Image1.Bitmap.Canvas.Width -80;
y2 := Image1.Bitmap.Canvas.Height -80;
MyRect := TRect.Create(x1, y1, x2, y2);
Image1.Bitmap.Canvas.Stroke.Color := TAlphaColorRec.Red;
Image1.Bitmap.Canvas.Stroke.Thickness := 8.0;
Image1.Bitmap.Canvas.BeginScene;
Image1.Bitmap.Canvas.DrawEllipse(MyRect, 10);
Image1.Bitmap.Canvas.EndScene;
end;
end;
end.