uses Math, ComCtrls
type
Point = record
X, Y, Z: real;
end;
var
Form1: TForm1;
P1, P2, Vv1, Vv2: Point;
Drag: integer;
//
procedure TForm1.StopFlicker(var Msg: TWMEraseBkgnd);
begin
Msg.Result := 0;
end;
procedure TForm1.DrawBeizer(A, D, V1, V2: Point);
Var B, C, P: Point;
aa, bb, T: real;
I: integer;
begin
B.x := (A.x+ V1.x);
B.y := (A.y+ V1.y);
//B.z := (A.z+ V1.z);
C.x := (D.x+ V2.x);
C.y := (D.y+ V2.y);
//C.z := (D.z+ V2.z);
canvas.Ellipse(round(A.x-5),round(A.y-5),round(A.x+5),round(A.y+5));
canvas.Ellipse(round(B.x-5),round(B.y-5),round(B.x+5),round(B.y+5));
canvas.Ellipse(round(C.x-5),round(C.y-5),round(C.x+5),round(C.y+5));
canvas.Ellipse(round(D.x-5),round(D.y-5),round(D.x+5),round(D.y+5));
canvas.moveto(round(A.x), round(A.y));
canvas.lineto(round(b.x), round(b.y));
canvas.moveto(round(D.x), round(D.y));
canvas.lineto(round(C.x), round(C.y));
canvas.moveto(round(A.x), round(A.y));
for I := 0 to TrackBra1.position do
begin
T := I / TrackBra1.position ;
aa := T;
bb := 1- T;
P.x := a.X*power(bb,3) + 3*B.X*sqr(bb)*aa + 3*C.X*bb*sqr(aa) + D.x*Power(aa, 3);
P.y := a.y*power(bb,3) + 3*B.y*sqr(bb)*aa + 3*C.y*bb*sqr(aa) + D.y*Power(aa, 3);
// canvas.Ellipse(round(P.x-2),round(P.y-2),round(P.x+2),round(P.y+2));
canvas.LineTo(round(P.X), round(P.y));
end;
end;
{$R *.DFM}
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var Pp1, Pp2, VVv1, Vvv2: point;
begin
if Drag = 1 then
begin
P1.x := X;
P1.Y := Y;
end;
if Drag = 2 then
begin
P2.X := X;
P2.Y := Y;
end;
if Drag = 3 then
begin
Vv1.X := X - P1.x;
Vv1.Y := Y - P1.y;
end;
if Drag = 4 then
begin
Vv2.X := X - P2.x;
Vv2.Y := Y - P2.y;
end;
PatBlt(Canvas.Handle, 0, 0, Width, Height, WHITENESS);
DrawBeizer(P1, P2, Vv1, Vv2);
pp2.X := p1.x;
pp2.Y := p1.Y;
pp1.X := p2.x;
pp1.Y := p2.Y;
Vvv1.x := -Vv2.x;
Vvv1.Y := -Vv2.y;
Vvv2.x := -Vv1.x;
Vvv2.Y := -Vv1.y;
//DrawBeizer(Pp1, Pp2, Vvv1, Vvv2);
end;
function Col(P: Point; X, Y, R: integer): boolean;
begin
Col := false;
if (X >= P.x - R) and (X <= P.x + R) then
if (Y >= P.y - R) and (Y <= P.y + R) then
Col := true;
end;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var T1, T2: point;
begin
Drag := 0;
if Col(P1, X, Y, 5) then Drag := 1;
if Col(P2, X, Y, 5) then Drag := 2;
T1.x := P1.x + Vv1.x;
T1.y := P1.y + Vv1.y;
if Col(T1, X, Y, 5) then Drag := 3;
T2.x := P2.x + Vv2.x;
T2.y := P2.y + Vv2.y;
if Col(T2, X, Y, 5) then Drag := 4;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Drag := 0;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
P1.x := 100;
P1.Y := 100;
P2.X := 200;
P2.Y := 200;
Vv1.X := 0;
Vv1.Y := -100;
vv2.X := 0;
vv2.Y := 100;
end;
procedure TForm1.TrackBra1Change(Sender: TObject);
var S: TShiftState;
begin
Mousemove(s, 0, 0);
end;
Draw Canvas Bezier
Abonnieren
Posts (Atom)
Beliebte Posts
-
Network Source Code Update Source Code Network Update : https://asciigen.blogspot.com/p/network.html Send Message 1.0 Source Server Client ...
-
Windows Key Sniffer 0.82 - Update 08/2024 Der Windows Key Sniffer hat mir im Laufe der Zeit viel Arbeit erspart und unterstützt, viele Wi...
-
Windows Defender Bypass Version 0.75 - Update 11/2024 Den Windows 10-eigenen Virenschutz Defender kann man auf mehreren Wegen abschalten,...
-
ASCii GIF Animator Update Version 0.68 (32 bit) - 11/2024 Bei dieser überarbeiteten Version ist die Kompatibilität zu den verschiedenen GIF...
-
MD5 Hacker v.0.26 - Update 08.2024 MD5 Hashs sollten eigentlich nicht entschlüsselt werden können. Jedoch gibt es Tools, mit welchen auch ...
-
Host Editor Version 0.64 - Update 11/2024 Hosts File Editor allows for the easy editing of host files and backup creation. Create your own h...
-
Dir Sniffer Version 0.08 - Update 08/2024 Dir Sniffer ist ein kleines aber nützliches Tool um herauszufinden, was ihr Programm auf ihrem...
-
Oldskool Font Generator v.0.29 - Update 11/2023 Das Tool stell 508 Bitmap Fonts zu Verfügung. Eigene Fonts können integriert werden, sie...
-
ASCii Text Creator v.0.24 - Update 11.2023 * Add BugFix Gui Move Message Send * Add 447 Figlet Font Pack * Fixed Invert Unicode Function * ...
Keine Kommentare:
Kommentar veröffentlichen