DrawPathEvenOdd

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

Descripción

Pinta la ruta actual usando la regla de relleno par-impar en lugar de la regla de enrollamiento distinto de cero que usa DrawPath. Con la regla par-impar, un punto se considera "dentro" de la ruta cuando un rayo trazado desde él cruza la ruta un número impar de veces — por ello, las subrutas superpuestas alternan entre bandas rellenas y sin rellenar sin considerar la dirección de la subruta

Sintaxis

Delphi

Function TPDFlib.DrawPathEvenOdd(PathOptions: Integer): Integer;

ActiveX

Function PDFlib::DrawPathEvenOdd(PathOptions As Long) As Long

DLL

int DLDrawPathEvenOdd(int InstanceID, int PathOptions);

Parámetros

PathOptionsModo de pintura:

0 — Solo contorno.
1 — Solo relleno (regla par-impar).
2 — Relleno y contorno

Valores devueltos

0Error: PathOptions está fuera de rango, no hay un documento abierto o no se ha iniciado ninguna ruta
1El trazado se pintó correctamente

Observaciones

Use la regla par-impar al construir formas como donas, arandelas o cualquier figura que perfore un agujero a través de un contorno mayor. Con la regla de relleno distinta de cero usada por DrawPath, la misma construcción funciona solo si el subtrazado interior se dibuja en dirección opuesta; con la regla par-impar, la dirección no importa

Ejemplo

// A filled square with a circular hole cut through it (donut)
PDF.SetFillColor(0, 0.4, 0.7);

PDF.StartPath(100, 100);
PDF.AddLineToPath(200, 100);
PDF.AddLineToPath(200, 200);
PDF.AddLineToPath(100, 200);
PDF.ClosePath;

// Inner circle — direction does not matter under even-odd
PDF.StartPath(170, 150);            // start on the right side of the circle
PDF.AddArcToPath(150, 150, 360);    // centre (150, 150), full revolution
PDF.ClosePath;

PDF.DrawPathEvenOdd(1);                // 1 = fill

Véase también

DrawPath, StartPath, AddArcToPath, ClosePath