PDFium Component Docs

CreatePath Methode

Dieser API-Eintrag behält Bezeichner, Signaturen, Codeblöcke und PDF-Begriffe in ihrer Originalform.
Komponente: TPdf  ·  Unit: PDFium
Create a new path object at an initial position.

Syntax

procedure CreatePath(X, Y: Single; FillMode: TPdfFillMode = fmNone; FillColor: TColor = clBlack; FillAlpha: Byte = $FF; Stroke: Boolean = True; StrokeColor: TColor = clBlack; StrokeAlpha: Byte = $FF; StrokeWidth: Single = 1.0; LineCap: TPdfLineCap = lcDefault; LineJoin: TPdfLineJoin = ljDefault; BlendMode: TPdfBlendMode = bmDefault);

FillModeTPdfFillMode. Füllregel für das Innere des Pfads: fmNone (keine Füllung), fmAlternate (Gerade-Ungerade-Regel) oder fmWinding (Nicht-Null-Windungsregel). Standard ist fmNone
FillColorTColor. Füllfarbe, die angewendet wird, wenn FillMode nicht fmNone ist. Standard ist clBlack
FillAlphaByte. Deckkraft der Füllung, wobei $00 vollständig transparent und $FF vollständig deckend ist. Standard ist $FF
StrokeBoolean. Wenn True, wird die Pfadkontur mit StrokeColor, StrokeAlpha und StrokeWidth gezeichnet. Standard ist True
StrokeColorTColor. Farbe der Pfadkontur. Standard ist clBlack
StrokeAlphaByte. Deckkraft der Kontur, wobei $00 vollständig transparent und $FF vollständig deckend ist. Standard ist $FF
StrokeWidthSingle. Breite der Konturlinie in PDF-User-Einheiten (Punkten). Standard ist 1.0
LineCapTPdfLineCap. Stil für offene Pfadendpunkte: lcDefault, lcButt, lcRound oder lcProjectingSquare. Standard ist lcDefault
LineJoinTPdfLineJoin. Stil an Verbindungsstellen von Pfadsegmenten: ljDefault, ljMiter, ljRound oder ljBevel. Standard ist ljDefault
BlendModeTPdfBlendMode. Mischmodus für das Pfadobjekt. Standard ist bmDefault (normal)

 

procedure CreatePath(X, Y, Width, Height: Single; FillMode: TPdfFillMode = fmNone; FillColor: TColor = clBlack; FillAlpha: Byte = $FF; Stroke: Boolean = True; StrokeColor: TColor = clBlack; StrokeAlpha: Byte = $FF; StrokeWidth: Single = 1.0; LineCap: TPdfLineCap = lcDefault; LineJoin: TPdfLineJoin = ljDefault; BlendMode: TPdfBlendMode = bmDefault);

FillModeTPdfFillMode. Fill rule for the rectangle interior. Default is fmNone.
FillColorTColor. Fill color for the rectangle. Default is clBlack.
FillAlphaByte. Opacity of the fill ($00–$FF). Default is $FF.
StrokeBoolean. When True, the rectangle outline is drawn. Default is True.
StrokeColorTColor. Color of the rectangle outline. Default is clBlack.
StrokeAlphaByte. Opacity of the stroke ($00–$FF). Default is $FF.
StrokeWidthSingle. Width of the outline stroke in points. Default is 1.0.
LineCapTPdfLineCap. Line cap style for the rectangle corners. Default is lcDefault.
LineJoinTPdfLineJoin. Line join style for the rectangle corners. Default is ljDefault.
BlendModeTPdfBlendMode. Compositing blend mode. Default is bmDefault.

Beschreibung

CreatePath beginnt mit dem Aufbau eines neuen Vektorpfadobjekts. Sie muss vor allen Pfadaufbau-Methoden (MoveTo, LineTo, BezierTo, ClosePath) aufgerufen werden, und die Sequenz muss mit einem Aufruf von AddPath abgeschlossen werden, um den Pfad auf der aktuellen Seite zu übernehmen.

Es stehen zwei Überladungen zur Verfügung. Die zweikoordinatische Form CreatePath(X, Y, ...) initialisiert einen leeren Pfad mit dem aktuellen Punkt bei (X, Y); Sie bauen die Form dann frei mit den Pfadsegment-Methoden auf. Die vierkoordinatische Form CreatePath(X, Y, Width, Height, ...) erzeugt direkt einen geschlossenen rechteckigen Pfad - zusätzliche Segmentaufrufe vor AddPath sind nicht nötig.

Alle visuellen Eigenschaften des Pfads - Füllfarbe und -regel, Konturfarbe, Breite, Deckkraft, Linienkappe, Linienverbindung und Mischmodus - werden beim Erzeugen über die optionalen Parameter gesetzt. Die Standardwerte ergeben eine 1-Punkt-schwarz konturierte Form ohne Füllung.

Es kann immer nur ein Pfad gleichzeitig aufgebaut werden. Wenn Sie CreatePath erneut aufrufen, bevor AddPath erfolgt ist, wird der vorherige ausstehende Pfad verworfen.

Beispiel

// Ein blau gefülltes Dreieck mit schwarzer 2-Punkt-Kontur zeichnen
Pdf1.NewPage(595, 842);
Pdf1.CreatePath(100, 100, fmWinding, clBlue, $FF, True, clBlack, $FF, 2.0);
Pdf1.LineTo(200, 300);
Pdf1.LineTo(300, 100);
Pdf1.ClosePath;
Pdf1.AddPath;

// Ein rot gefülltes Rechteck mit der 4-Koordinaten-Überladung zeichnen
Pdf1.CreatePath(50, 400, 200, 80, fmWinding, clRed);
Pdf1.AddPath;

Siehe auch

MoveTo, LineTo, BezierTo, ClosePath, AddPath