PROBLEMA COM IMPRESSAO DE IMAGEM
Boa tarde!
Estou com dificuldades em imrprimir uma imagem de um codigo de barras em VB6.
Funcao usada para gerar o codigo de barras:
Private Function GenerateCode128(Str As String, XPos As Single, YPos As Single, Optional BarWidth As Integer = 1) As Single
Dim Code128 As New clsCode128
Dim BarCodeWidth As Long
Me.picBarCode.Cls
Me.picBarCode.Width = 1
BarCodeWidth = Code128.Code128_Print(Str, Me.picBarCode, BarWidth, True)
Me.PaintPicture Me.picBarCode.Image, XPos, YPos, Me.picBarCode.ScaleWidth, Me.picBarCode.ScaleHeight, 0, 0, Me.picBarCode.ScaleWidth, Me.picBarCode.ScaleHeight
Me.CurrentX = XPos + BarCodeWidth / 2 - Me.TextWidth(Str) / 2
Me.CurrentY = YPos + Me.picBarCode.ScaleHeight + 2
Me.Print Str
GenerateCode128 = Me.CurrentY
End Function
Para exibir o codigo de barras na tela funciona ok, porem para imprimir nao:
CodBarras = GenerateCode128([Ô]TESTE[Ô], 10, 10, 1)
Printer.PaintPicture Me.picBarCode, 250, 7100, 2000, 650
Alguem pode me ajudar?
Desde ja agradeco.
Jonas
PS: Desculpem a falta de acentos.
Estou com dificuldades em imrprimir uma imagem de um codigo de barras em VB6.
Funcao usada para gerar o codigo de barras:
Private Function GenerateCode128(Str As String, XPos As Single, YPos As Single, Optional BarWidth As Integer = 1) As Single
Dim Code128 As New clsCode128
Dim BarCodeWidth As Long
Me.picBarCode.Cls
Me.picBarCode.Width = 1
BarCodeWidth = Code128.Code128_Print(Str, Me.picBarCode, BarWidth, True)
Me.PaintPicture Me.picBarCode.Image, XPos, YPos, Me.picBarCode.ScaleWidth, Me.picBarCode.ScaleHeight, 0, 0, Me.picBarCode.ScaleWidth, Me.picBarCode.ScaleHeight
Me.CurrentX = XPos + BarCodeWidth / 2 - Me.TextWidth(Str) / 2
Me.CurrentY = YPos + Me.picBarCode.ScaleHeight + 2
Me.Print Str
GenerateCode128 = Me.CurrentY
End Function
Para exibir o codigo de barras na tela funciona ok, porem para imprimir nao:
CodBarras = GenerateCode128([Ô]TESTE[Ô], 10, 10, 1)
Printer.PaintPicture Me.picBarCode, 250, 7100, 2000, 650
Alguem pode me ajudar?
Desde ja agradeco.
Jonas
PS: Desculpem a falta de acentos.
Tente esse código: Printer.Orientation = vbPRORLandscape
Veja camo fica:
CodBarras = GenerateCode128([Ô]TESTE[Ô], 10, 10, 1)
Printer.Orientation = vbPRORLandscape
Printer.PaintPicture Me.picBarCode, 250, 7100, 2000, 650
Veja camo fica:
CodBarras = GenerateCode128([Ô]TESTE[Ô], 10, 10, 1)
Printer.Orientation = vbPRORLandscape
Printer.PaintPicture Me.picBarCode, 250, 7100, 2000, 650
Tópico encerrado , respostas não são mais permitidas