ClosePath

Gráficos vectoriales, definición y trazado de rutas

Descripción

Cierra el subtrazado actual del trazado iniciado por StartPath. Se dibuja una línea recta desde el punto actual hasta el punto inicial del trazado, lo que garantiza que la figura sea una única forma cerrada en lugar de dos extremos conectados únicamente por una unión de trazos. Al llamar a ClosePath no se pinta el trazado; llame después a DrawPath o DrawPathEvenOdd para trazarlo o rellenarlo

Sintaxis

Delphi

Function TPDFlib.ClosePath: Integer;

ActiveX

Function PDFlib::ClosePath() As Long

DLL

int DLClosePath(int InstanceID);

Valores devueltos

0Error — no hay ningún documento abierto o no se ha iniciado ninguna ruta
1El subtrazado actual se ha cerrado

Observaciones

Cerrar la ruta evita un hueco y un remate plano al trazar. En rellenos el cierre está implícito, pero cerrarla mejora la salida y es obligatorio antes de otra subruta con StartPath

Ejemplo

// Draw a closed triangle, stroked
PDF.SetStrokeColor(0, 0, 0);
PDF.SetLineWidth(1);
PDF.StartPath(100, 100);
PDF.AddLineToPath(200, 100);
PDF.AddLineToPath(150, 180);
PDF.ClosePath;          // line back to (100, 100)
PDF.DrawPath(0);        // 0 = outline only

Véase también

StartPath, AddLineToPath, AddCurveToPath, DrawPath, DrawPathEvenOdd