关于vb分割图片问题~~~~求高手解决
目前有以下代码‘
Public Function PixelToDotData(ByRef src() As Long) As Byte() Dim ret() As Byte Dim l As Long l = ((UBound(src) + 1) / 8) + 1 ReDim ret(l * 2 - 1) ret(0) = 1 ret(l) = 2 Dim i As Long Dim n As Long Dim m As Long Dim bitshift As Long For i = 0 To UBound(src) Step 1 n = i \ 8 bitshift = i Mod 8 Select Case src(i) Case COLOR_RED ret(n + 1) = ret(n + 1) Or (2 ^ (7 - bitshift)) ret(n + 1 + l) = Not (ret(n + 1 + l) Imp (2 ^ (7 - bitshift))) Case COLOR_GREEN ret(n + 1) = Not (ret(n + 1) Imp (2 ^ (7 - bitshift))) ret(n + 1 + l) = ret(n + 1 + l) Or (2 ^ (7 - bitshift)) Case COLOR_ORENGE ret(n + 1) = ret(n + 1) Or (2 ^ (7 - bitshift)) ret(n + 1 + l) = ret(n + 1 + l) Or (2 ^ (7 - bitshift)) End Select Next i PixelToDotData = retEnd Function