Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls;
- type
- TForm1 = class(TForm)
- Image1: TImage;
- procedure Image1Click(Sender: TObject);
- private
- FPoly: array of TPoint;
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.Image1Click(Sender: TObject);
- var
- P: TPoint;
- begin
- P := Image1.ScreenToClient(Mouse.CursorPos);
- SetLength(FPoly, Length(FPoly) + 1);
- FPoly[High(FPoly)] := P;
- Image1.Canvas.Polygon(FPoly);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment