Azerthur
asked on
How to give my form an organic shape ?
I want to give my delphi form an organic shape.
How do I do that ?
What if I also want a permanent canvas ?
How do I do that ?
What if I also want a permanent canvas ?
ASKER
sorry I have delphi 3 only !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and then, of course, there's the one I use:
http://www.torry.webnorth.com/vcl/forms/plasma.zip
http://www.torry.webnorth.com/vcl/forms/plasma.zip
Here's sompe code for a polygone as a weird shaped window. That's not exactly organic, but let yer imagination work.
procedure TForm1.FormCreate(Sender: TObject);
var
lPoints: array [0..11] of TPoint;
begin
(* Define the lPoints of a W shape *)
lPoints[0] := Point(0 , 0 );
lPoints[1] := Point(50 , 0 );
lPoints[2] := Point(180, 200 );
lPoints[3] := Point(218, 100 );
lPoints[4] := Point(256, 200 );
lPoints[5] := Point(385, 0 );
lPoints[6] := Point(435, 0 );
lPoints[7] := Point(256, 300 );
lPoints[8] := Point(218, 200 );
lPoints[9] := Point(180, 300 );
(* Define the region *)
prRegion := CreatePolygonRgn(lPoints,/ / This a pointer to the previously defined lPoints
10,// The number of lPoints
ALTERNATE);// The mode to be used for filling the window/polygon
(* Set the window to have the above defined region *)
SetWindowRgn(Handle,// The handle of your form
prRegion,// The handle of your defined region
True);// Indicates the window is to be redrawn now
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
DeleteObject(prRegion);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
lPoints: array [0..11] of TPoint;
begin
(* Define the lPoints of a W shape *)
lPoints[0] := Point(0 , 0 );
lPoints[1] := Point(50 , 0 );
lPoints[2] := Point(180, 200 );
lPoints[3] := Point(218, 100 );
lPoints[4] := Point(256, 200 );
lPoints[5] := Point(385, 0 );
lPoints[6] := Point(435, 0 );
lPoints[7] := Point(256, 300 );
lPoints[8] := Point(218, 200 );
lPoints[9] := Point(180, 300 );
(* Define the region *)
prRegion := CreatePolygonRgn(lPoints,/
10,// The number of lPoints
ALTERNATE);// The mode to be used for filling the window/polygon
(* Set the window to have the above defined region *)
SetWindowRgn(Handle,// The handle of your form
prRegion,// The handle of your defined region
True);// Indicates the window is to be redrawn now
end;
procedure TForm1.FormDestroy(Sender:
begin
DeleteObject(prRegion);
end;
http://www.lawrenz.com/coolform/