| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
Touchsoftwares Master


Registrado: 16 Dic 2002Mensajes: 869Ubicación: MEXICO Playa del Carmen
|
Publicado: Lun 30 Ago, 2010 7:53 pm Asunto: Printer()->Canvas->Font->Height Comportamiento Raro |
|
|
Expongo un comportamiento raro que repare, pero si alguien sabe el porque; seria bueno lo compartiera
Debria Imprimir 5 Lineas
| Código: |
for(int i=0;i<5>Canvas->TextOut(x,y, "Hola Mundo");
y=y+Printer()->Canvas->Font->Height+1;
}
|
Solo Imprime 1 , debido a que
| Código: |
Printer()->Canvas->Font->Height
|
DEVUELVE UN VALOR NEGATIVO!!!!
y las posiciones x,y del TexOut quedan con y en negativo
Asi que se corrigio asi:
| Código: |
abs(Printer()->Canvas->Font->Height)
|
Para devolver el alto de la letra seleccionada de la impresora positivo
Alguien sabe por qeu el alto de una letra devuelve un valor negativo!!! _________________ Ing. Gabriel Góngora Navarrete
TouchSoftwares Inc
http://www.touchsoftwares.com |
|
| Volver arriba |
|
 |
_Leo Site Admin

Registrado: 11 Ago 2002Mensajes: 1875Ubicación: Lanzarote - Islas Canarias (España)
|
Publicado: Lun 30 Ago, 2010 8:49 pm Asunto: |
|
|
No es raro, es el comportamiento normal. En el siguiente enlace del API puedes ver la razón y también que esto no se refiere a alto en pixels:
[LOGFONT Structure]
http://msdn.microsoft.com/en-us/library/dd145037.aspx
(En esta pagina busca: lfHeight)
Si necesitas saber el alto en pixels de una manera sencilla, puedes usar:
int altoPixels= Canvas->TextHeight("Mg"); |
|
| Volver arriba |
|
 |
Touchsoftwares Master


Registrado: 16 Dic 2002Mensajes: 869Ubicación: MEXICO Playa del Carmen
|
Publicado: Lun 30 Ago, 2010 10:15 pm Asunto: Gracias Leo |
|
|
| Cita: |
> 0 The font mapper transforms this value into device units and matches it against the cell height of the available fonts.
0 The font mapper uses a default height value when it searches for a match.
< 0 The font mapper transforms this value into device units and matches its absolute value against the character height of the available fonts.
|
_________________ Ing. Gabriel Góngora Navarrete
TouchSoftwares Inc
http://www.touchsoftwares.com |
|
| Volver arriba |
|
 |
|