'得到图象数据 '先是40个字节的DIB头 '然后就是长*宽*4字节的数据 Dim sz As Long Dim img() As Long sz = vx * vy + 40 ReDim img(sz - 1)
m_objBasicVideo.GetCurrentImage sz * 4, img(0)
'如果是图片格式未知 If (img(0) <> 40) Or (img(3) <> &H200001) Then MsgBox "未知的格式!" Exit Sub End If '取得图象数据 Dim x As Long, y As Long Dim col As Long, rr As Long, gg As Long, bb As Long Dim pp As Long pp = 10 '数据的格式是从下到上,从左到右的方式 For y = 0 To vy - 1 For x = 0 To vx - 1 col = img(pp)
bb = col And 255& gg = (col \ 256&) And 255& rr = (col \ 65536) And 255& col = RGB(rr, gg, bb) '输出到图片框中去 Me.Picture2.PSet (x, vy - y), col pp = pp + 1 Next Next