THPDFPage.ClosePathFillAndStroke

THPDFPage

 

顶部  上一页  下一页

Close, fill and stroke current path.

 

Delphi 语法:

procedure ClosePathFillAndStroke;

 

C++ 语法:

void __fastcall ClosePathFillAndStroke( void );

 

说明

使用 nonzero winding number rule 判定填充区域,先关闭 path,再填充并 stroke

非零环绕数规则

For simple convex paths, the nonzero winding number rule defines the inside and outside as one would intuitively expect. The more interesting cases are those involving complex or self-intersecting paths like the ones shown in Picture For a path consisting of a five-pointed star, drawn with five connected straight line segments intersecting each other, the rule considers the inside to be the entire area enclosed by the star, including the pentagon in the center. For a path composed of two concentric circles, the areas enclosed by both circles are considered to be inside, provided that both are drawn in the same direction. If the circles are drawn in opposite directions, only the "doughnut" shape between them is inside, according to the rule; the "doughnut hole" is outside.

[PICTURE nozerorul.bmp]

 

代码示例

program Rectangle;
{$APPTYPE CONSOLE}
uses
    SysUtils, Graphics, Classes, HPDFDoc;

var
    HPDF: THotPDF;

begin
    HPDF := THotPDF.Create(nil);
    try
        HPDF.AutoLaunch := true;                             // PDF file will be shown automatically
        HPDF.FileName := '\Rectangle.pdf';                   // Set PDF filename
        HPDF.BeginDoc;                                       // Create PDF file
        HPDF.CurrentPage.Rectangle( 10, 10, 100, 100 );      // Draw rectangle and fill
        HPDF.CurrentPage.ClosePathFillAndStroke;
        HPDF.EndDoc;                                         // Close PDF file
    finally
        HPDF.Free;
    end;
end.