[SUB] <FUNCION> Print7913Char (Imprime en PicBox caracteres tipo Google Fair).

Iniciado por 79137913, Mayo 27, 2013, 03:36:32 PM

Tema anterior - Siguiente tema

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

HOLA!!!

Una imagen vale mas que 1000 palabras:



Y un link de donde salio la idea (miren abajo de la pagina)
depende la conbinacion de colores que uses
No tienes permitido ver enlaces. Registrate o Entra a tu cuenta
mira abajo

Código: vb
Private Sub Command1_Click()
Call Print7913Char(Picture1, Text2.Text, RGB(128, 128, 128), RGB(0, 255, 0), 2, 1, 10)
Call Print7913Char(Picture2, Text1.Text, RGB(128, 128, 128), RGB(0, 255, 0), 2, 1, 10)
Call Print7913Char(Picture3, Text3.Text, RGB(128, 128, 128), RGB(0, 255, 0), 2, 1, 10)
Call Print7913Char(Picture4, Text4.Text, RGB(128, 128, 128), RGB(0, 255, 0), 2, 1, 10)
End Sub

Private Sub Print7913Char(Pic As PictureBox, expression As String, Optional ColorOff As Long = 8421504, Optional ColorOn As Long = 65280, Optional AnchorOn As Long = 3, Optional AnchorOff As Long = 2, Optional BetweenChars As Long = 0)
Dim ChrPos As String
Dim char(72) As Boolean
Dim charpos(288) As Long
Dim a() As String
Dim AChr As Double
'123456789
'    5      0
' 25/|\75 1 125
' /|\|/|\ 2 25
'|\|/|\|/|3 375
'|/|\|/|\|4 500
'|\|/|\|/|5 625
'|/|\|/|\|6 750
' \|/|\|/ 7 875
'   \|/   8 1000
'                        "99.72X1...72Y1...72X2...72Y2"
ChrPos = "99.0.0.0.500.500.500.0.0.0.0.250.250.250.500.750.750.750.0.0.0.250.500.500.500.750.1000.1000.0.250.250.250.500.750.750.750.1000.0.0.250.500.500.500.750.1000.1000.0.250.250.250.500.750.750.750.1000.0.0.250.500.500.500.750.1000.0.0.0.0.250.500.750.0.0.0.0.0.0.0.0.0.0.0.0.0.125.125.125.125.125.125.125.0.250.250.250.250.250.250.250.250.250.375.375.375.375.375.375.375.375.375.500.500.500.500.500.500.500.500.500.625.625.625.625.625.625.625.625.625.0.750.750.750.750.750.750.750.0.0.0.0.875.875.875.0.0.0.0.0.0.250.500.750.0.0.0.0.0.250.500.500.500.750.1000.0.0.250.250.250.500.750.750.750.1000.0.0.250.500.500.500.750.1000.1000.0.250.250.250.500.750.750.750.1000.0.0.250.500.500.500.750.1000.1000.0.250.250.250.500.750.750.750.0.0.0.0.500.500.500.0.0.0.0.0.0.125.125.125.0.0.0.0.250.250.250.250.250.250.250.0.375.375.375.375.375.375.375.375.375.500.500.500.500.500.500.500.500.500.625.625.625.625.625.625.625.625.625.750.750.750.750.750.750.750.750.750.0.875.875.875.875.875.875.875.0.0.0.0.1000.1000.1000.0.0.0"
Pic.ScaleMode = 3
Pic.DrawWidth = AnchorOff
Pic.Cls
AChr = Pic.ScaleHeight / 1000
a = Split(ChrPos, ".")
For x = 1 To 288
charpos(x) = a(x)
Next
For y = 1 To Len(expression)
    Select Case Asc(Mid(LCase(expression), y, 1))
            Case 48 '0
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 49 '1
                a = Split("9 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0")
            Case 50 '2
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 51 '3
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 52 '4
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 53 '5
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 54 '6
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 55 '7
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 56 '8
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1 1 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 57 '9
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0")
            Case 97 'a
                a = Split("9 0 1 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 98 'b
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 99 'c
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 100 'd
                a = Split("9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 101 'e
                a = Split("9 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 102 'f
                a = Split("9 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0")
            Case 103 'g
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 104 'h
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 105 'i
                a = Split("9 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0")
            Case 106 'j
                a = Split("9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 107 'k
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 108 'l
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 109 'm
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0")
            Case 110 'n
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 111 'o
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 112 'p
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0")
            Case 113 'q
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 114 'r
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 115 's
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 116 't
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0")
            Case 117 'u
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0")
            Case 118 'v
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 0 0 0 1 1 0 0 0 1 1 0 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0")
            Case 119 'w
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 120 'x
                a = Split("9 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0")
            Case 121 'y
                a = Split("9 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0")
            Case 122 'z
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 0 0 0")
            Case 32 '" "
                a = Split("9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0")
            Case 46 '.
                a = Split("9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0")
            Case Else
                a = Split("9 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0")
    End Select
    For x = 1 To 72
    char(x) = a(x)
    Next
    For x = 1 To 72
        If char(x) Then
            Pic.DrawWidth = AnchorOn
            Pic.Line (((BetweenChars + (AChr * 1000)) * (y - 1)) + charpos(x) * AChr, charpos(x + 72) * AChr)-(((BetweenChars + (AChr * 1000)) * (y - 1)) + charpos(x + 144) * AChr, charpos(x + 216) * AChr), ColorOn
            Pic.DrawWidth = AnchorOff
        Else
            Pic.Line (((BetweenChars + (AChr * 1000)) * (y - 1)) + charpos(x) * AChr, charpos(x + 72) * AChr)-(((BetweenChars + (AChr * 1000)) * (y - 1)) + charpos(x + 144) * AChr, charpos(x + 216) * AChr), ColorOff
        End If
    Next
Next

End Sub


GRACIAS POR LEER!!!
"Algunos creen que soy un bot, puede que tengan razon"
"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

*Shadow Scouts Team*                                                No tienes permitido ver enlaces. Registrate o Entra a tu cuenta