TLama

Untitled

Mar 20th, 2013
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.60 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, ExtCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Image1: TImage;
  12.     procedure Image1Click(Sender: TObject);
  13.   private
  14.     FPoly: array of TPoint;
  15.   public
  16.     { Public declarations }
  17.   end;
  18.  
  19. var
  20.   Form1: TForm1;
  21.  
  22. implementation
  23.  
  24. {$R *.dfm}
  25.  
  26. procedure TForm1.Image1Click(Sender: TObject);
  27. var
  28.   P: TPoint;
  29. begin
  30.   P := Image1.ScreenToClient(Mouse.CursorPos);
  31.   SetLength(FPoly, Length(FPoly) + 1);
  32.   FPoly[High(FPoly)] := P;
  33.  
  34.   Image1.Canvas.Polygon(FPoly);
  35. end;
  36.  
  37. end.
Advertisement
Add Comment
Please, Sign In to add comment