This repository has been archived on 2024-12-25. You can view files and clone it, but cannot push or open issues or pull requests.
OldPascalProjects/Samples/Graphics/GraphWPF/DrawCircleByMouse.pas
2023-06-20 21:52:24 +03:00

16 lines
306 B
ObjectPascal

uses GraphWPF;
begin
var x1,y1: real;
var c: Color;
OnMouseDown := procedure(x,y,mb) -> begin
(x1,y1) := (x,y);
c := RandomColor;
end;
OnMouseMove := procedure(x,y,mb) -> if mb=1 then
begin
var r := Sqrt(Sqr(x1-x)+Sqr(y1-y));
Window.Clear;
Circle(x1,y1,r,c);
end;
end.