Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Eigene Shape Formen (https://www.delphipraxis.net/86461-eigene-shape-formen.html)

halinchen 14. Feb 2007 16:08

Re: Eigene Shape Formen
 
Ich geh mal von der Prozedur Paint aus. (Also muss erstmal stimmen, aber es kam ja noch kein Protest :roll: )
Delphi-Quellcode:
procedure TMyShape.Paint();
begin
  inherited;
  If Self.Shape = stKaro then begin
     Canvas.PenPos(Trunc(Self.ClientWidth/2),0); //Setzt die Stift Position ganz oben in die Mitte
     Canvas.LineTo(0,Trunc(Self.Clientheight/2)); //zeichnet eine Linie von der Stiftposition zu ganz links und Mitte
     Canvas.LineTo(Trunc(Self.ClientWidth/2),Self.Clientheight);//ganz unten mitte
     Canvas.LineTo(Self.ClientWidth,Trunc(Self.Clientheight/2));// ganz rechts mitte
  end;
end;
Das sollte die Umrisse erstmal machen.
(Ähm, habs nicht getestet...)

Guck mal in der Delphi Hilfe nach Delphi-Referenz durchsuchenTCanvas und dessen Eigenschaften und Methoden.

Wie man die Flächen ausfüllt weiß ich jetzt auch nicht. Such mal im Forum.


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:22 Uhr.
Seite 2 von 2     12   

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