用VB如何实现将即时输入的文字转化成如下面所显示的点阵(取像素出来的)
此为宋体。如果可以取出,那么可以随意换成其他字体更好!0000000000000000000000000000001100000000
0000110000000000110000000000001100000000
0000110000000000110000011111111111111111
0000100000001100110000010000000000000011
1111111111001100110000000000000000000000
1111111111001100110000000111111111111000
0000000100001100110000000110000000011000
0000000100001100110000000110000000011000
0110001100001100110000000111111111111000
0011001100001100110000000000000000000000
0001101000001100110000000000000000000000
0000111000001100110000111111111111111111
0000011000001100110000110000000000000011
0000111100001100110000110001111111000011
0001101100001100110000000001111111000000
0011000110000000110000000001100001000000
0111000011000000110000000001100001000010
1110000010000000110000000011000001000011
0100000000000011110000011111000001111111
0000000000000011000000001100000001111110这个上面是我的名字“刘亮”两个字!

解决方案 »

  1.   

    用TextOut把文字写在PictureBox里,然后再一个像素一个像素的读。
      

  2.   

    当然可以,使用DeviceContext呗。
      

  3.   

    Option ExplicitPrivate Sub Command1_Click()
        Dim X As Integer, Y As Integer
        Dim W As Integer, H As Integer
        Me.Picture1.ScaleMode = vbPixels
        Me.Picture1.Font.Name = "宋体"
        Me.Picture1.Font.Size = 11
        Me.Picture1.ForeColor = vbWhite
        Me.Picture1.BackColor = vbBlack
        Me.Picture1.Print Text1.Text
        W = Me.Picture1.TextWidth(Text1.Text)
        H = Me.Picture1.TextHeight(Text1.Text)
        For Y = 1 To H
            For X = 1 To W - 1
                If Me.Picture1.Point(X, Y) = 0 Then
                    Debug.Print "0";
                Else
                    Debug.Print "#";
                End If
            Next X
            Debug.Print
        Next Y
    End Sub
      

  4.   

    更正一下:Option ExplicitPrivate Sub Command1_Click()
        Dim X As Integer, Y As Integer
        Dim W As Integer, H As Integer
        Me.Picture1.ScaleMode = vbPixels
        Me.Picture1.Font.Name = "宋体"
        Me.Picture1.Font.Size = 11
        Me.Picture1.ForeColor = vbWhite
        Me.Picture1.BackColor = vbBlack
        Me.Picture1.Cls
        Me.Picture1.Print Text1.Text
        W = Me.Picture1.TextWidth(Text1.Text)
        H = Me.Picture1.TextHeight(Text1.Text)
        For Y = 1 To H
            For X = 1 To W - 1
                If Me.Picture1.Point(X, Y) = 0 Then
                    Debug.Print "0";
                Else
                    Debug.Print "#";
                End If
            Next X
            Debug.Print
        Next Y
    End Sub