|
Sets dash pattern type.
Sintaxe Delphi:
procedure SetDash ( DashArray: array of Byte; Phase: Byte );
Sintaxe C++:
void __fastcall SetDash ( const Byte * DashArray, const int DashArray_Size, Byte Phase);
Descrição:
O padrão de tracejado de linha controla o padrão de traços e lacunas usado para contornar caminhos. Ele é especificado por uma matriz de traços e uma fase de traço. Os elementos da matriz indicam os comprimentos alternados de traços e lacunas; a fase indica a distância dentro do padrão na qual iniciar o tracejado
Examples of line dash patterns
| DASH ARRAY |
DASH PHASE |
APPEARANCE |
DESCRIPTION |
| [] [ 3 ] [ 2 ] [ 2 1 ] [ 3 5 ] [ 2 3 ] |
0 0 1 0 6 11 |
 |
No dash 3 units on, 3 units off ... 1 on, 2 off, 2 on, 2 off, … 2 on, 1 off, 2 on, 1 off, … 2 off, 3 on, 5 off, 3 on, 5 off, … 1 on, 3 off, 2 on, 3 off, 2 on, … |
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; // Criar o arquivo PDF
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; // Fechar o arquivo PDF
finally
HPDF.Free;
end;
end.
Consulte também: NoDash
|