Foro de elhacker.net

Programación => .NET (C#, VB.NET, ASP) => Mensaje iniciado por: Rudy21 en 28 Agosto 2011, 09:26 am



Título: Picturbox.drawidth en vb net
Publicado por: Rudy21 en 28 Agosto 2011, 09:26 am
Estoy intentando pasar este codigo de vb6 a .net pero me pierdo en el PICTUREBOX

alguna idea?

lo que hace es generar un código de barras

Código:
Private Sub GeraCodBar39(ByVal x As String, ByVal Sclr As Integer)
        Dim pic As PictureBox       
        Dim bc4(0 To 20) As String
        Dim barchar As String
        Dim barcolor As String
        Dim bs As Single
        Dim bwn As Single
        Dim ac As Integer
        Dim s As Integer
        Dim bct As Integer
        Dim bcl As Integer
        ac = 1
        pic.Image = Nothing
        bc4(ac - 1) = "121121211"
        For bct = 1 To Len(x)
            barchar = Mid(x, bct, 1)
            If barchar = " " Then barchar = "SP"
            For s = 0 To UBound(zz1)
                If UCase(barchar) = zz1(s) Then
                    bc4(ac) = zz2(s)
                    ac = ac + 1
                    Exit For
                End If
            Next s
        Next bct
        bc4(ac) = "121121211"
        bs = 200
        pic.DrawWidth = 1
        For bct = 0 To ac
            x = bc4(bct)
            barcolor = Color.Black.ToString
            For s = 1 To Len(x)
                bwn = (Val(Mid(x, s, 1))) * Sclr
                For bcl = 1 To bwn
                pic.Line (bs + bcl, 100)-Step(0, 500), barcolor
                    drawli()
                Next bcl
                If barcolor = Color.Black.ToString Then barcolor = Color.White.ToString Else barcolor = Color.Black.ToString
                bs = bs + bwn
            Next s
            For bcl = 1 To Sclr
                pic.Line (bs + bcl, 100)-Step(0, 500), vbWhite
            Next bcl
            bs = bs + bcl
        Next bct
        pic.FontSize = 16 : pic.CurrentX = 200 : pic.CurrentY = 600 : pic.Print(UCase(txtdata))
    End Sub

los errores me los da en

pic.FontSize
pic.CurrentX
pic.CurrentY
pic.Print(UCase(txtdata)
pic.DrawWidth

lei que tiene que ser con PEN y Graphics pero me pierdo