Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- begin
- Image1.Canvas.MoveTo(X,Y);
- end;
- procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
- Y: Integer);
- begin
- Image1.Canvas.Pen.Width:=spnh.Value;
- if (X<=Image1.Width div 2) and (Y<=Image1.Height div 2) then Image1.Canvas.Pen.Color:=clRed;
- if (X>=Image1.Width div 2) and (Y>=Image1.Height div 2) then Image1.Canvas.Pen.Color:=clBlue;
- if (X>=Image1.Width div 2) and (Y<=Image1.Height div 2) then Image1.Canvas.Pen.Color:=clYellow;
- if (X<=Image1.Width div 2) and (Y>=Image1.Height div 2) then Image1.Canvas.Pen.Color:=clGreen;
- if Shift = [ssLeft] then Image1.Canvas.LineTo(X,Y);
- end;
Advertisement
Add Comment
Please, Sign In to add comment