下面的vb语句是将jpg图片转换成二进制么?为什么输出的内容会是"255 216 255 224 0 16 74 70 73 70 0 1 1 1 0 96 0 96 0 0 255 219 0 67 0 7 5 5 6 5 4 7 6 5 6 8 7 7 8 10 17 11 10 9 9 10 21 15 16 12 17 24 21 26 25 24 21 24 23 27 30 39 33 27 29 37 29 23 24 34 46 34 37 40 41 43 44 43 26 32 47 51 47 42 50 39 42 43 42 255 219"
这样的看起来像是ascii码啊
求高手啊!!!
1 Dim bytData() As Byte 2 Open "C:\1.jpg" For Binary As #1 3 ReDim bytData(FileLen("C:\1.jpg")) 4 Get #1, , bytData 5 Close #1 6 Dim i As Long 7 Dim strTmp As String 8 For i = LBound(bytData) To UBound(bytData) 9 DoEvents 10 strTmp = strTmp & bytData(i) & " " 11 Next 12 Dim b() As Byte 13 ReDim b(Len(strTmp) / 3 - 1) 14 For i = 0 To Len(strTmp) / 3 - 1 15 DoEvents 16 b(i) = Val("&H" & Mid(strTmp, i * 3 + 1, 2)) 17 Next
你这是字节数,一个字节占8位,255的二进制表示是 11111111,具体你可以看下位运算