Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Regions (https://www.delphipraxis.net/8841-regions.html)

Pseudemys Nelsoni 13. Sep 2003 07:03


Regions
 
hi,

wie kriege ich meine form1 ecken rund? hab schon im forum gesucht, aber nur einen verweiss zur msdn gefunden, und mit der komm ich nicht klar...hatte es mit "CreateRectRgn(90,90,90,90); versucht *g*

Alexander 13. Sep 2003 07:19

Re: Regions
 
Ich meine in der Code-Library steht dazu ein Beispiel.

Pseudemys Nelsoni 13. Sep 2003 07:29

Re: Regions
 
also ich finde nichts

Alexander 13. Sep 2003 07:33

Re: Regions
 
Dann mache es so:
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
var
  rgn: HRGN;
begin
  Form1.Borderstyle := bsNone;
  rgn := CreateRoundRectRgn(0,// x-coordinate of the region's upper-left corner
    0,           // y-coordinate of the region's upper-left corner
    ClientWidth, // x-coordinate of the region's lower-right corner
    ClientHeight, // y-coordinate of the region's lower-right corner
    40,          // height of ellipse for rounded corners
    40);         // width of ellipse for rounded corners
  SetWindowRgn(Handle, rgn, True);
end


{ The CreatePolygonRgn function creates a polygonal region. } 


procedure TForm1.FormCreate(Sender: TObject);
const
  C = 20;
var
  Points: array [0..7] of TPoint;
  h, w: Integer;
begin
  h := Form1.Height;
  w := Form1.Width;
  Points[0].X := C;    Points[0].Y := 0;
  Points[1].X := 0;    Points[1].Y := C;
  Points[2].X := 0;    Points[2].Y := h - c;
  Points[3].X := C;    Points[3].Y := h;

  Points[4].X := w - c; Points[4].Y := h;
  Points[5].X := w;    Points[5].Y := h - c;

  Points[6].X := w;    Points[6].Y := C;
  Points[7].X := w - C; Points[7].Y := 0;

  SetWindowRgn(Form1.Handle, CreatePolygonRgn(Points, 8, WINDING), True);
end;

Pseudemys Nelsoni 13. Sep 2003 07:35

Re: Regions
 
danke:)

fkerber 13. Sep 2003 07:35

Re: Regions
 
Hi!

Ich denke mal, das könnte dir helfen:

http://www.delphipraxis.net/internal...ect.php?t=9011

ciao fkerber

[Edit] Einfach zu langsam :cry: [/Edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:14 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz