AddBoxToPath
Gráficos vectoriales, definición y dibujo de trazados
Descripción
Agrega un rectángulo alineado a ejes como una subruta cerrada completa a la ruta actual. A diferencia de AddLineToPath, esta función no requiere una llamada previa a StartPath — se inicia y se cierra automáticamente una subruta nueva
Sintaxis
Delphi
Function TPDFlib.AddBoxToPath(Left, Top, Width, Height: Double): Integer;
ActiveX
Function PDFlib::AddBoxToPath(Left As Double, Top As Double, Width As Double, Height As Double) As Long
DLL
int DLAddBoxToPath(int InstanceID, double Left, double Top, double Width, double Height);
Parámetros
| Left | La coordenada horizontal del borde izquierdo del cuadro |
|---|---|
| Top | La coordenada vertical del borde superior del cuadro |
| Width | El ancho del cuadro. Los anchos negativos se reflejan para que el rectángulo siga teniendo una extensión positiva |
| Height | La altura del cuadro |
Valores devueltos
| 0 | Falló — no hay ningún documento abierto |
|---|---|
| 1 | El rectángulo se agregó a la ruta actual |
Observaciones
Se pueden agregar varios cuadros a la misma ruta; junto con DrawPathEvenOdd, esta es la forma más simple de dibujar formas con huecos rectangulares. Después de agregar todos los cuadros, llame a DrawPath (regla de relleno) o DrawPathEvenOdd (regla par-impar) para pintar el resultado
Ejemplo
// A filled rectangle frame: outer box with an inner box punched out
PDF.SetFillColor(0.2, 0.4, 0.8);
PDF.AddBoxToPath(100, 100, 200, 120); // outer
PDF.AddBoxToPath(120, 120, 160, 80); // inner cut-out
PDF.DrawPathEvenOdd(1); // 1 = fillVéase también
StartPath, AddLineToPath, AddArcToPath, DrawPath, DrawPathEvenOdd