Page 2 of 2

Re: Clase para Graficos Vectoriales

PostPosted: Wed Sep 21, 2022 1:55 pm
by Compuin
Muchas gracias maestro, es como dice, cuestion de ir probando.

Pregunta final, para el trazado de las lineas cortadas es la misma funcion que se usa para la linea azul completa?

Re: Clase para Graficos Vectoriales

PostPosted: Wed Sep 21, 2022 2:22 pm
by Antonio Linares
Aclaración de Mr. Rao que tiene más experiencia en este tema:

For conversion between Pixels and Units( "INCHES", "CM", "MM" ), we have two methods
Units2Pix( top, left, width, height, Units ( "INCHES","CM","MM" ))
and
Pix2Units( ... )

But for using many methods, we need not do any calculations ourselves.
Just mention the Units as parameter. Printer class will internally does all calculations and print.

Eg:
Line( nTop, nLeft, nBottom, nRight, oPen, cUnits )
METHOD Box( nRow, nCol, nBottom, nRight, anoPen, noBrush, aText, cUnits )
METHOD AngleArc( x, y, r, angle, sweep, uPen, uBrush, cUnits )
METHOD Ellipse( nRow, nCol, nBottom, nRight, oPen, nFillClr, aText, cUnits )

Usage: oPrn:Box( 20, 20, 50, 60, oPen, oBrush, aText, "CM" )

There are only very few methods without this support:
Arc(...), Chord(..), Pie(...)
For such few methods, we can use Units2Pix(..) to convert INCHES/CM/MM to pixels.

For all common usage of printer, the user is not bothered about the conversion calculations

Re: Clase para Graficos Vectoriales

PostPosted: Wed Sep 21, 2022 3:36 pm
by Antonio Linares
DEFINE PEN oPen STYLE 2 // PS_DOT
#define PS_SOLID 0
#define PS_DASH 1 /* ------- */
#define PS_DOT 2 /* ....... */
#define PS_DASHDOT 3 /* ... */
#define PS_DASHDOTDOT 4 /* ...._ */

Re: Clase para Graficos Vectoriales

PostPosted: Wed Sep 21, 2022 3:36 pm
by Antonio Linares
Os ha dado por la sastreria de repente ? :-D

Re: Clase para Graficos Vectoriales

PostPosted: Wed Sep 21, 2022 3:46 pm
by Compuin
Gracias maestro, es un arte que aprendi de adolescente y me gustaria crear un producto para diseno de camisas y chalecos masculinos.

Un hobbie como tal :D

Re: Clase para Graficos Vectoriales

PostPosted: Wed Sep 21, 2022 6:27 pm
by jose_murugosa
Muy interesante....