Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/10/2007, 07:03
Manu_Leon
 
Fecha de Ingreso: marzo-2005
Ubicación: Sevilla
Mensajes: 277
Antigüedad: 19 años, 2 meses
Puntos: 2
Prblemas al imprimir texto

Buenas, estoy desarrollando una aplicacion en la que me es necesario imprimir texto en un determinado ángulo.

intento imprimir el texto en angulo de la sigueinte forma:

Utilizo la clase LOGFONT:
Código:
Public Declare Function CreateFontIndirect Lib "gdi32" Alias _
     "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
   Public Declare Function SelectObject Lib "gdi32" (ByVal hDC _
     As Long, ByVal hObject As Long) As Long
   Public Declare Function DeleteObject Lib "gdi32" (ByVal _
     hObject As Long) As Long
   Public Const LF_FACESIZE = 32

   Public Type LOGFONT
     lfHeight As Long
     lfWidth As Long
     lfEscapement As Long
     lfOrientation As Long
     lfWeight As Long
     lfItalic As Byte
     lfUnderline As Byte
     lfStrikeOut As Byte
     lfCharSet As Byte
     lfOutPrecision As Byte
     lfClipPrecision As Byte
     lfQuality As Byte
     lfPitchAndFamily As Byte
     lfFaceName As String * LF_FACESIZE
   End Type
Y tras esto, hago algo así:

Código:
Dim fuente As LOGFONT
Dim hfont As Long
Dim ret As Long
Dim prevfont As Long

fuente.lfEscapement = 90 * 10 'grados*10 
    fuente.lfFaceName = "Arial"
 
     fuente.lfWeight = 400
    

     hfont = CreateFontIndirect(fuente)
     prevfont = SelectObject(Printer.hDC, hfont)
          Printer.Print ("texto a 90 grados")
            ret = SelectObject(Printer.hDC, prevfont)
            ret = DeleteObject(hfont)
elcaso es que si cambio Printer por un picturebox, en el picturebox se imprime bien, en angulo, pero en la impresora se imprime sin angulo, a 0 grados.

Sabéis de que puede ser?

Un slaudo y gracias de antemano