AddLineToPath
Gráficos vectoriales, definición y trazado de rutas
Descripción
Añade una línea desde el punto actual hasta (EndX, EndY) y mueve el punto actual a (EndX, EndY) para continuar la siguiente primitiva
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
| EndX | La coordenada horizontal del punto final de la línea |
|---|---|
| EndY | La coordenada vertical del punto final de la línea |
Valores devueltos
| 0 | Error — no hay ningún documento abierto o no se ha iniciado ningún trazado mediante StartPath |
|---|---|
| 1 | El segmento de línea se añadió a la ruta actual |
Observaciones
Llame a StartPath antes del primer AddLineToPath para establecer el punto inicial de la ruta. Después de componer por completo la ruta, llame a DrawPath o DrawPathEvenOdd para pintarla. Utilice 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 onlyVéase también
StartPath, AddCurveToPath, AddArcToPath, AddBoxToPath, ClosePath, DrawPath