Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
- Y: Integer);
- begin
- if r then
- begin
- if speedbutton1.Down then
- begin
- image1.Canvas.Pen.Color:=colordialog1.Color;
- Image1.Canvas.LineTo(x, y);
- end;
- if speedbutton3.Down then
- begin
- image1.Canvas.Pen.Color:=clwhite;
- image1.Canvas.Pen.Width:=spinedit1.Value;
- Image1.Canvas.LineTo(x, y);
- end;
- if speedbutton4.Down then
- begin
- image1.Canvas.MoveTo(x0, y0);
- Image1.Canvas.LineTo(x2,y2);
- Image1.Canvas.MoveTo(x0, y0);
- Image1.Canvas.LineTo(x,y);
- x2 := x; y2 :=y;
- end;
- if speedbutton5.Down then
- begin
- image1.Canvas.Rectangle(x0, y0, x2, y2);
- Image1.Canvas.Rectangle(x0, y0,x, y);
- x2 := x; y2 :=y;
- end;
- if speedbutton6.Down then
- begin
- image1.Canvas.Ellipse(x0, y0, x2, y2);
- Image1.Canvas.Ellipse(x0, y0,x, y);
- x2 := x; y2 :=y;
- end;
- end;
- end;
- procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- begin
- r:=true;
- if speedbutton1.Down then
- Image1.Canvas.MoveTo(x, y);
- if speedbutton3.Down then
- Image1.Canvas.MoveTo(x, y);
- if speedbutton4.Down then
- begin
- x0 := x; y0 := y;
- x2:=x; y2:=y;
- Image1.Canvas.Pen.Mode:=PmNotXor;
- end;
- if speedbutton5.Down then
- begin
- x0 := x; y0 := y;
- x2:=x; y2:=y;
- Image1.Canvas.Pen.Mode:=PmNotXor;
- end;
- if speedbutton6.Down then
- begin
- x0 := x; y0 := y;
- x2:=x; y2:=y;
- Image1.Canvas.Pen.Mode:=PmNotXor;
- end;
- end;
- procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- begin
- if speedbutton1.Down then
- Image1.Canvas.LineTo(x, y);
- if speedbutton3.Down then
- Image1.Canvas.LineTo(x, y);
- r:=false;
- if speedbutton4.Down then
- begin
- Image1.Canvas.Pen.Mode:=PmCopy;
- image1.Canvas.MoveTo(x0, y0);
- Image1.Canvas.LineTo(x2,y2);
- Image1.Canvas.MoveTo(x0, y0);
- Image1.Canvas.LineTo(x,y);
- end;
- if speedbutton5.Down then
- begin
- Image1.Canvas.Pen.Mode:=PmCopy;
- image1.Canvas.Rectangle(x0, y0, x2, y2);
- Image1.Canvas.Rectangle(x0, y0, x, y);
- end;
- if speedbutton6.Down then
- begin
- Image1.Canvas.Pen.Mode:=PmCopy;
- image1.Canvas.Ellipse(x0, y0, x2, y2);
- Image1.Canvas.Ellipse(x0, y0, x, y);
- end;
- if speedbutton2.Down then
- begin
- c:=image1.canvas.Pixels[x,y];
- image1.Canvas.FloodFill(x,y,c,fssurface);
- end;
- end;
- procedure TForm1.SpinEdit1Change(Sender: TObject);
- begin
- Image1.Canvas.Pen.Width := SpinEdit1.Value;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement