(Gast)
n/a Beiträge
|
27. Jan 2003, 22:51
Zitat von fedderle:
Geht das auch mit der ganzen Form. Also, das ich ne Runde Form erstellen kann?
Siehe Library: WinApi, der erste und der vierte Beitrag von mir.
Noch ein paar möglichkeiten:
Explosion:
Delphi-Quellcode:
Var
P:Array[0..24] of TPoint;
CLFRgn:HRgn;
Begin
P[0]:=Point(0,0);
P[1]:=Point(50,Form1.Height div 6);
P[2]:=Point(0,2*(Form1.Height div 6));
P[3]:=Point(50,3*(Form1.Height div 6));
P[4]:=Point(0,4*(Form1.Height div 6));
P[5]:=Point(50,5*(Form1.Height div 6));
P[6]:=Point(0,Form1.Height);
P[7]:=Point(Form1.Width div 6,Form1.Height -50);
P[8]:=Point(2*(Form1.Width div 6),Form1.Height);
P[9]:=Point(3 *(Form1.Width div 6),Form1.Height -50);
P[10]:=Point(4*(Form1.Width div 6),Form1.Height);
P[11]:=Point(5 *(Form1.Width div 6),Form1.Height -50);
P[12]:=Point(Form1.Width,Form1.Height);
P[13]:=Point(Form1.Width-50,5*(Form1.Height div 6));
P[14]:=Point(Form1.Width,4*(Form1.Height div 6));
P[15]:=Point(Form1.Width-50,3*(Form1.Height div 6));
P[16]:=Point(Form1.Width,2*(Form1.Height div 6));
P[17]:=Point(Form1.Width-50,Form1.Height div 6);
P[18]:=Point(Form1.Width,0);
P[19]:=Point(5*(Form1.Width div 6),50);
P[20]:=Point(4*(Form1.Width div 6),0);
P[21]:=Point(3*(Form1.Width div 6),50);
P[22]:=Point(2*(Form1.Width div 6),0);
P[23]:=Point(Form1.Width div 6,50);
P[24]:=Point(0,0);
CLFRgn:=CreatePolygonRgn(P,24,Alternate);
SetWindowRgn(Form1.Handle,CLFRgn,True);
End;
Schatteneffekt:
Delphi-Quellcode:
Var
CLFRgn:HRgn;
CLFRgnTmp:HRgn;
Begin
CLFRgn:=CreateRectRgn(0,0,Form1.Width-10,Form1.Height-10);
CLFRgnTmp:=CreateRectRgn(10,10,Form1.Width,Form1.Height);
CombineRgn(CLFRgn,CLFRgn,CLFRgnTmp,RGN_OR);
SetWindowRgn(Form1.Handle,CLFRgn,True);
End;
Schöne Titelleiste:
Delphi-Quellcode:
Var
CLFRgn:HRgn;
CLFRgnTmp:HRgn;
Begin
CLFRgn:=CreateRectRgn(0,0,Form1.Width,Form1.Height);
CLFRgnTmp:=CreateRectRgn(10,10,Form1.Width-10,30);
CombineRgn(CLFRgn,CLFRgn,CLFRgnTmp,RGN_DIFF);
CLFRgnTmp:=CreateRectRgn((Form1.Width div 2)-5,10,(Form1.Width div 2)+10,30);
CombineRgn(CLFRgn,CLFRgn,CLFRgnTmp,RGN_OR);
CLFRgnTmp:=CreateRectRgn(10,18,Form1.Width-10,22);
CombineRgn(CLFRgn,CLFRgn,CLFRgnTmp,RGN_OR);
CLFRgnTmp:=CreateRectRgn(12,12,Form1.Width-12,28);
CombineRgn(CLFRgn,CLFRgn,CLFRgnTmp,RGN_OR);
SetWindowRgn(Form1.Handle,CLFRgn,True);
End;
Rechteck auf rechteck:
Delphi-Quellcode:
Var
CLFRgn:HRgn;
CLFRgnTmp:HRgn;
Begin
CLFRgn:=CreateRectRgn(0,30,Form1.Width-30,Form1.Height);
CLFRgnTmp:=CreateRectRgn(Form1.Width-80,0,Form1.Width,60);
CombineRgn(CLFRgn,CLFRgn,CLFRgnTmp,RGN_OR);
SetWindowRgn(Form1.Handle,CLFRgn,True);
End;
Trapezformen hätte ich noch, musst nur sagen auf welcher Seite die schmale Seite sein soll...
Grüsse, Daniel
|