AddLineToPath

Gráficos vectoriales, definición y dibujo de trazados

Descripción

Agrega una línea recta al trazado actual, desde el punto actual del trazado hasta el nuevo punto en (EndX, EndY) El punto actual se mueve después a (EndX, EndY) para que la siguiente primitiva de trazado continúe desde allí

Sintaxis

Delphi

Function TPDFlib.AddLineToPath(EndX, EndY: Double): Integer;

ActiveX

Function PDFlib::AddLineToPath(EndX As Double, EndY As Double) As Long

DLL

int DLAddLineToPath(int InstanceID, double EndX, double EndY);

Parámetros

EndXLa coordenada horizontal del punto final de la línea
EndYLa coordenada vertical del punto final de la línea

Valores devueltos

0Error — no hay ningún documento abierto o no se inició ningún trazado con StartPath
1El segmento de línea se agregó a la ruta actual

Observaciones

Llama a StartPath antes del primer AddLineToPath para establecer el punto inicial del trazado. Después de ensamblar completamente el trazado, llama a DrawPath o DrawPathEvenOdd para pintarlo. Usa ClosePath para dibujar un segmento final de vuelta al punto inicial

Ejemplo

// A zig-zag polyline
PDF.SetStrokeColor(0, 0, 0);
PDF.SetLineWidth(1);
PDF.StartPath(50, 100);
PDF.AddLineToPath(100, 150);
PDF.AddLineToPath(150, 100);
PDF.AddLineToPath(200, 150);
PDF.AddLineToPath(250, 100);
PDF.DrawPath(0);                       // 0 = outline only

Véase también

StartPath, AddCurveToPath, AddArcToPath, AddBoxToPath, ClosePath, DrawPath