Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8. Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  9. ExtCtrls;
  10.  
  11. type
  12.  
  13. { TForm1 }
  14.  
  15. TForm1 = class(TForm)
  16. Button1: TButton;
  17. Button2: TButton;
  18. Edit1: TEdit;
  19. Image1: TImage;
  20. procedure Button1Click(Sender: TObject);
  21. procedure Button2Click(Sender: TObject);
  22. private
  23. { private declarations }
  24. public
  25. { public declarations }
  26. end;
  27.  
  28. var
  29. Form1: TForm1;
  30.  
  31. implementation
  32.  
  33. {$R *.lfm}
  34.  
  35. { TForm1 }
  36. procedure Draw();
  37. var i:integer;
  38. Var X,Y,L: double;
  39. begin
  40. with Form1.Image1.Canvas do begin
  41. brush.Color:=clForm;
  42. FillRect(0, 0, Form1.Image1.Width, Form1.Image1.Height);
  43.  
  44. {Pen.Color:=clGreen;
  45. Pen.Width:=3;
  46. Brush.Color:=clRed;
  47. EllipseC(50,75,25,25);}
  48. L:=1;
  49. for i:= 1 to 360 do begin
  50. L:=L+1;
  51. y:=sin(x);
  52. X:=Sin(L*pi/180);
  53. Y:=Cos(L*pi/180);
  54.  
  55. Pen.Color:=clGreen;
  56. Pen.Width:=3;
  57. Brush.Color:=clRed;
  58. Ellipse(round(X),round(Y),5,5);
  59. end;
  60. //end;
  61.  
  62. {Pen.Color:=clBlack;
  63. Pen.Width:=50;
  64. Line(10, 120, Form1.Image1.Width-10, 120);}
  65. {Brush.Color:=clForm;
  66. Font.Color:=clBlue;
  67. Font.Name:='Courier';
  68. Font.Size:=30;
  69. Font.Style:=[fsBold];
  70. TextOut(60,150, 'ss');}
  71. end;
  72. end;
  73.  
  74. procedure TForm1.Button1Click(Sender: TObject);
  75. begin
  76. Draw();
  77. end;
  78.  
  79. procedure TForm1.Button2Click(Sender: TObject);
  80. begin
  81. close;
  82. end;
  83.  
  84.  
  85.  
  86. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement