Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  2. Y: Integer);
  3. begin
  4. if r then
  5. begin
  6. if speedbutton1.Down then
  7. begin
  8. image1.Canvas.Pen.Color:=colordialog1.Color;
  9. Image1.Canvas.LineTo(x, y);
  10. end;
  11.  
  12. if speedbutton3.Down then
  13. begin
  14. image1.Canvas.Pen.Color:=clwhite;
  15. image1.Canvas.Pen.Width:=spinedit1.Value;
  16. Image1.Canvas.LineTo(x, y);
  17. end;
  18. if speedbutton4.Down then
  19. begin
  20. image1.Canvas.MoveTo(x0, y0);
  21. Image1.Canvas.LineTo(x2,y2);
  22. Image1.Canvas.MoveTo(x0, y0);
  23. Image1.Canvas.LineTo(x,y);
  24. x2 := x; y2 :=y;
  25. end;
  26. if speedbutton5.Down then
  27. begin
  28. image1.Canvas.Rectangle(x0, y0, x2, y2);
  29. Image1.Canvas.Rectangle(x0, y0,x, y);
  30. x2 := x; y2 :=y;
  31.  
  32. end;
  33. if speedbutton6.Down then
  34. begin
  35. image1.Canvas.Ellipse(x0, y0, x2, y2);
  36. Image1.Canvas.Ellipse(x0, y0,x, y);
  37. x2 := x; y2 :=y;
  38.  
  39. end;
  40. end;
  41. end;
  42.  
  43. procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  44. Shift: TShiftState; X, Y: Integer);
  45. begin
  46. r:=true;
  47. if speedbutton1.Down then
  48.  
  49. Image1.Canvas.MoveTo(x, y);
  50. if speedbutton3.Down then
  51.  
  52. Image1.Canvas.MoveTo(x, y);
  53. if speedbutton4.Down then
  54. begin
  55. x0 := x; y0 := y;
  56. x2:=x; y2:=y;
  57. Image1.Canvas.Pen.Mode:=PmNotXor;
  58. end;
  59. if speedbutton5.Down then
  60. begin
  61. x0 := x; y0 := y;
  62. x2:=x; y2:=y;
  63. Image1.Canvas.Pen.Mode:=PmNotXor;
  64. end;
  65. if speedbutton6.Down then
  66. begin
  67. x0 := x; y0 := y;
  68. x2:=x; y2:=y;
  69. Image1.Canvas.Pen.Mode:=PmNotXor;
  70. end;
  71.  
  72. end;
  73.  
  74. procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  75. Shift: TShiftState; X, Y: Integer);
  76. begin
  77.  
  78. if speedbutton1.Down then
  79. Image1.Canvas.LineTo(x, y);
  80. if speedbutton3.Down then
  81. Image1.Canvas.LineTo(x, y);
  82. r:=false;
  83.  
  84. if speedbutton4.Down then
  85. begin
  86. Image1.Canvas.Pen.Mode:=PmCopy;
  87. image1.Canvas.MoveTo(x0, y0);
  88. Image1.Canvas.LineTo(x2,y2);
  89. Image1.Canvas.MoveTo(x0, y0);
  90. Image1.Canvas.LineTo(x,y);
  91. end;
  92. if speedbutton5.Down then
  93. begin
  94. Image1.Canvas.Pen.Mode:=PmCopy;
  95. image1.Canvas.Rectangle(x0, y0, x2, y2);
  96. Image1.Canvas.Rectangle(x0, y0, x, y);
  97. end;
  98. if speedbutton6.Down then
  99. begin
  100. Image1.Canvas.Pen.Mode:=PmCopy;
  101. image1.Canvas.Ellipse(x0, y0, x2, y2);
  102. Image1.Canvas.Ellipse(x0, y0, x, y);
  103. end;
  104.  
  105. if speedbutton2.Down then
  106. begin
  107. c:=image1.canvas.Pixels[x,y];
  108. image1.Canvas.FloodFill(x,y,c,fssurface);
  109. end;
  110.  
  111.  
  112.  
  113.  
  114. end;
  115. procedure TForm1.SpinEdit1Change(Sender: TObject);
  116. begin
  117. Image1.Canvas.Pen.Width := SpinEdit1.Value;
  118. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement