黑色的点为1
空白的为0

解决方案 »

  1.   

    装进picturebox扫描
    不过你打算用什么样的数据结构存储这些信息?
      

  2.   

    正好有这个例子
      好久前写的了
    '**************************************************************************
    '                       SAVE DATA 
    '**************************************************************************
      rivate Sub Command1_Click()
       Dim i As Integer
       Dim j As Integer
       Dim s As Long
       Dim x As Long
       s = 1
       Open App.Path & "\Pic.Int" For Binary As #1
       
       For i = Picture1.ScaleLeft To Picture1.ScaleLeft + Picture1.ScaleWidth
         For j = Picture1.ScaleTop To Picture1.ScaleTop + Picture1.ScaleHeight
             If Picture1.Point(i, j) >= QBColor(7) Then
                x = 1
             Else
                x = 0
             End If
             Put #1, s, x
             s = Seek(1)
           DoEvents
         Next
        
       Next
     Close #1
     MsgBox "OK"
             
    End Sub
    '**************************************************************************
    '                       LOAD DATA
    '**************************************************************************
    Private Sub Command2_Click()
       Dim i As Integer
       Dim j As Integer
       Dim s As Long
       Dim x As Long
       s = 1
       Open App.Path & "\Pic.Int" For Binary As #1
        For i = Picture1.ScaleLeft To Picture1.ScaleLeft + Picture1.ScaleWidth
          For j = Picture1.ScaleTop To Picture1.ScaleTop + Picture1.ScaleHeight
                Get #1, s, x
                s = Seek(1)
                If x = 0 Then
                     Picture1.PSet (i, j), QBColor(15)
                Else
                     Picture1.PSet (i, j), QBColor(0)
                End If
          
          Next
       Next
       
       Close #1
       
       
    End SubPrivate Sub Form_Load()
     Picture1.Picture = LoadPicture("")
    End Sub
      

  3.   

    bmp文件本身就是非常简单的了,还要转换成只有0和1表示的文件,就算如此,也要有文件头,否则图片的宽度高度等信息如何表示?