unit zf;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
FMX.Controls.Presentation, FMX.Objects;
type
Tzeichnung =
class(TForm)
Image1 : TImage;
Panel1 : TPanel;
Button1 : TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
zeichnung: Tzeichnung;
implementation
{$R *.fmx}
procedure Tzeichnung.Button1Click(Sender: TObject);
var MyBitmap: TBitmap;
MyRect : TRectF;
begin
MyBitmap := TBitmap.Create(0, 0);
try
MyRect.Create(50, 30, 150, 200);
// A record on the stack, does not Free
MyBitmap.Assign(Image1.Bitmap);
MyBitmap.Canvas.BeginScene;
MyBitmap.Canvas.Stroke.Kind := TBrushKind.Solid;
MyBitmap.Canvas.Stroke.Color := TAlphaColors.Black;
MyBitmap.Canvas.Stroke.Thickness := 4;
MyBitmap.Canvas.DrawRect(MyRect, 20, 20, AllCorners, 1.0);
MyBitmap.Canvas.EndScene;
// Display the result
Image1.Bitmap := MyBitmap;
finally
MyBitmap.Free;
end;
end;
end.