AddBoxToPath
Grafica vettoriale, definizione e disegno dei tracciati
Descrizione
Aggiunge al tracciato un rettangolo allineato agli assi come sottotracciato chiuso. A differenza di AddLineToPath, non richiede StartPath: il sottotracciato viene aperto e chiuso automaticamente
Sintassi
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);
Parametri
| Left | La coordinata orizzontale del bordo sinistro del riquadro |
|---|---|
| Top | La coordinata verticale del bordo superiore del riquadro |
| Width | Larghezza del riquadro. Le larghezze negative vengono riflesse affinché l'estensione resti positiva |
| Height | L'altezza del riquadro |
Valori restituiti
| 0 | Operazione non riuscita — nessun documento aperto |
|---|---|
| 1 | Il rettangolo è stato aggiunto al tracciato corrente |
Note
È possibile aggiungere più riquadri allo stesso tracciato; con DrawPathEvenOdd si creano facilmente fori rettangolari. Infine chiamare DrawPath o DrawPathEvenOdd
Esempio
// 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 = fillVedere anche
StartPath, AddLineToPath, AddArcToPath, DrawPath, DrawPathEvenOdd