THPDFPage.SetDash

THPDFPage

 

맨 위  이전  다음

대시 패턴 종류를 설정합니다

 

Delphi 구문:

procedure SetDash ( DashArray: array of Byte; Phase: Byte );

 

C++ 구문:

void __fastcall SetDash ( const Byte * DashArray, const int DashArray_Size, Byte Phase);

 

설명:

Line dash pattern은 path stroke에 사용되는 dash 및 gap의 pattern을 제어합니다. Dash array와 dash phase로 지정됩니다. Dash array element는 교대로 나타나는 dash와 gap의 length를 지정하는 number이며, dash phase는 dash를 시작할 dash pattern 내부 distance를 지정합니다

 

선 대시 패턴 예

대시 배열

대시 위상

모양

설명

[]

[ 3 ]

[ 2 ]

[ 2 1 ] 

[ 3 5 ]

[ 2 3 ]

0

0

1

0

6

11

Dash pattern example

대시 없음

3단위 켜짐, 3단위 꺼짐 ... 

1 켜짐, 2 꺼짐, 2 켜짐, 2 꺼짐, … 

2 켜짐, 1 꺼짐, 2 켜짐, 1 꺼짐, … 

2 꺼짐, 3 켜짐, 5 꺼짐, 3 켜짐, 5 꺼짐, … 

1 켜짐, 3 꺼짐, 2 켜짐, 3 꺼짐, 2 켜짐, …        

 

Code Example

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

var
    HPDF: THotPDF;

const
    DashArray: array [0..3] of Byte = ( 6, 4, 2, 4 );

begin
    HPDF := THotPDF.Create(nil);
    try
        HPDF.AutoLaunch := true;                       // PDF file will be shown automatically
        HPDF.FileName := '.\Ellipse.pdf';              // Set PDF filename
        HPDF.BeginDoc;                                 // Create PDF file

        HPDF.CurrentPage.SetDash( DashArray, 0 );      // Set  - . -  dash pattern
        HPDF.CurrentPage.MoveTo ( 20, 20 );            // Move current point to 20, 20
        HPDF.CurrentPage.LineTo ( 300, 100 );          // Draw line from current point to 200, 100
        HPDF.CurrentPage.Stroke;                       // and stroke

        HPDF.CurrentPage.NoDash;                       // Set solid dash pattern
        HPDF.CurrentPage.MoveTo ( 300, 100 );          // Move current point to 300, 100
        HPDF.CurrentPage.LineTo ( 10, 200 );           // Draw line from current point to 10, 100
        HPDF.CurrentPage.Stroke;                       // and stroke

        HPDF.EndDoc;                                   // Close PDF file
    finally
        HPDF.Free;
    end;
end.

 

참조: NoDash