Autor Tema: Consulta sobre GDI  (Leído 2928 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Bazooka

  • Terabyte
  • *****
  • Mensajes: 951
  • Reputación: +31/-20
  • El pibe Bazooka
    • Ver Perfil
    • Desof sistemas
Consulta sobre GDI
« en: Diciembre 29, 2010, 05:33:54 pm »
Hola gente tengo que escribir sobre un picture texto (ejemplo Nº 000001) y opcionalmente imagenes el tema es que tengo que colocar varios textos en distintos lugares y angulos. Por donde puedo empezar a urgar para hacerlo creo que con GDI se podria no? Además el usuario seleccionaria el tipo de fuente asi que debiera poder adaptarse a cualquier font.

Gracias!!
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las mismas cosas.

LeandroA

  • Administrador
  • Petabyte
  • *****
  • Mensajes: 1128
  • Reputación: +151/-8
    • Ver Perfil
Re:Consulta sobre GDI
« Respuesta #1 en: Diciembre 29, 2010, 07:02:35 pm »
Hola Mike si porsupuesto lo puedes hacer con Gdi y otras DLL pero tambien con algunas funciones de VB tales como "Print" para los texto y PaintPicture para las imagenes. lo unico que no podrias mediante las funciones de vb es rotar el texto, para eso te paso un ejemplo del api guide utilizando algunas apis

Código: (vb) [Seleccionar]
'In general section
Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Const LF_FACESIZE = 32
Private 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(LF_FACESIZE) As Byte
End Type
'In form
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net

    Dim RotateMe As LOGFONT
    'Set graphic-mode to 'persistent graphic'
    Me.AutoRedraw = True
    'Rotate degrees
    Deg = 270
    'Size (in points)
    Size = 20
    'Set the rotation degree
    RotateMe.lfEscapement = Deg * 10
    'Set the height of the font
    RotateMe.lfHeight = (Size * -20) / Screen.TwipsPerPixelY
    'Create the font
    rFont = CreateFontIndirect(RotateMe)
    'Select the font n the Form's device context
    Curent = SelectObject(Me.hdc, rFont)
    'Print some text ...
    Me.CurrentX = 500
    Me.CurrentY = 200
    Me.Print "hola mundo"
End Sub

en fin el no se exactamente todo lo que tienes o quieres que hacer pero mejor anda preguntando cosas especificas, asi vamos por parte.
« última modificación: Diciembre 29, 2010, 10:39:10 pm por xkiz »

Bazooka

  • Terabyte
  • *****
  • Mensajes: 951
  • Reputación: +31/-20
  • El pibe Bazooka
    • Ver Perfil
    • Desof sistemas
Re:Consulta sobre GDI
« Respuesta #2 en: Diciembre 30, 2010, 08:14:03 pm »
Buenisimo LEandro muchas gracias ya estoy urgando lo que me pasaste y algo de Lavolpe que encontre en Planet Source.
Feliz año para vos y para todos los internautas!!!
« última modificación: Diciembre 30, 2010, 08:19:39 pm por xkiz »
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las mismas cosas.