PDFium Component Docs

CreatePath Yöntem

Bu API girdisi tanımlayıcıları, imzaları, kod bloklarını ve PDF terimlerini özgün biçiminde korur.
Bileşen: TPdf  ·  Birim: PDFium
Başlangıç konumunda yeni bir yol nesnesi oluşturur

Söz dizimi

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. Fill rule for the path interior: fmNone (no fill), fmAlternate (even-odd rule), or fmWinding (non-zero winding rule). Default is fmNone.
FillColorTColor. Fill color applied when FillMode is not fmNone. Default is clBlack.
FillAlphaByte. Dolgunun opaklığı; burada $00 tamamen saydam, $FF tamamen opaktır. Varsayılan değer $FF'tir.
StrokeBoolean. When True, the path outline is drawn using StrokeColor, StrokeAlpha, and StrokeWidth. Default is True.
StrokeColorTColor. Color of the path outline. Default is clBlack.
StrokeAlphaByte. Çizginin opaklığı; burada $00 tamamen saydam, $FF tamamen opaktır. Varsayılan değer $FF'tir.
StrokeWidthSingle. Width of the stroke line in PDF user units (points). Default is 1.0.
LineCapTPdfLineCap. Style applied to open path endpoints: lcDefault, lcButt, lcRound, or lcProjectingSquare. Default is lcDefault.
LineJoinTPdfLineJoin. Style applied at path segment joins: ljDefault, ljMiter, ljRound, or ljBevel. Default is ljDefault.
BlendModeTPdfBlendMode. Compositing blend mode for the path object. Default is 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.

Açıklama

CreatePath yeni bir vektör yol nesnesinin oluşturulmasına başlar. MoveTo, LineTo, BezierTo, ClosePath gibi yol oluşturma yöntemlerinden önce çağrılmalıdır ve dizinin AddPath çağrısı ile tamamlanması gerekir; böylece yol geçerli sayfaya işlenir.

İki aşırı yükleme vardır. İki koordinatlı CreatePath(X, Y, ...) biçimi, geçerli noktası (X, Y) olan boş bir yol başlatır; ardından şekli yol segmenti yöntemleriyle serbestçe oluşturursunuz. Dört koordinatlı CreatePath(X, Y, Width, Height, ...) biçimi doğrudan kapalı bir dikdörtgen yol oluşturur — AddPath öncesinde ek segment çağrısı gerekmez.

Yolun tüm görsel özellikleri — dolgu rengi ve kuralı, çizgi rengi, genişlik, opaklık, çizgi ucu, çizgi birleşimi ve karışım modu — isteğe bağlı parametreler aracılığıyla oluşturma anında ayarlanır. Varsayılan değerler, dolgusu olmayan 1 point siyah çizgili bir dış hat üretir.

Aynı anda yalnızca bir yol oluşturulabilir. AddPath çağrılmadan önce CreatePath yeniden çağrılırsa önceki bekleyen yol atılır.

Örnek

// Draw a filled blue triangle with a 2-pt black outline
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;

// Draw a red filled rectangle using the 4-coordinate overload
Pdf1.CreatePath(50, 400, 200, 80, fmWinding, clRed);
Pdf1.AddPath;

Ayrıca bkz.

MoveTo, LineTo, BezierTo, ClosePath, AddPath