aviファイルを再生中にフレームのビットマップデータを取得して、
そのビットマップを表示したいのですがどうしても上手くいきません。
どなたかご教授願えないでしょうか?
'mGrp:QuartzTypeLib.FilgraphManager
'bv:QuartzTypeLib.IBasicVideo
Dim bmpInfo As BITMAPINFO
Dim rc
Dim bfSize As Long
Dim buf() As Long
mGrp.Pause
With bmpInfo
With .bmiHeader
.biSize = Len(bmpInfo.bmiHeader)
.biWidth = bv.VideoWidth
.biHeight = bv.VideoHeight
.biPlanes = 1
.biBitCount = 32
.biCompression = 0
.biSizeImage = 0
.biXPelsPerMeter = 0
.biYPelsPerMeter = 0
.biClrUsed = 0
.biClrImportant = 0
End With
End With
bfSize = bv.VideoWidth * bv.VideoHeight * 4 - 1
ReDim buf(bfSize)
bv.GetCurrentImage bfSize, buf(0)
rc = SetDIBitsToDevice(Me.Picture2.hdc, 0, 0, _
bv.VideoWidth, bv.VideoHeight, _
0, 0, 0, bv.VideoHeight, _
buf(0), bmpInfo, 0)
If rc > 0 Then
MsgBox 成功?
Else
MsgBox 失敗
End If
これだとノイズのようなビットマップが表示されます。
どこがまずいんでしょうか?