Deanna Earley formulated the question :
1) if the failed image process generates a file that opens as it is an
image file in any Windows image viewer as sell as loads without error
into a VB picture box but has no visible image what more does the
header tell us? The non-image that is seen is a pastel pink.
Windows Explorer Properties Summary says
Width 640, Height 480, Horz DPI 96, Vert DPI 96, Bit Depth 24, Frame
Count 1.
2) I searched all over for WDM samples and tutorials and documentation.
Found very little. Do you have any sources, links etc?
3) (m_tBI) is unfilled. perhaps a placeholder for the call use. But
remember, this same routine is called when a USB webcam is used and
produces a correct image. So maybe there are some defaults properly
set in the drivers in one case and not the other. I have not yet tried
to examine it after the call. It seems that StretchDIBits is happy
with pixel width, height and the data provided and nothing else. This
is for all webcam resolutions tried from 160x120 to 1920x1080 (USB
webcam only).
Here is the macro <snip 1> for framecallback. I left in all my notes.
<snip 2> is the call to VFW to generate the bitmap; basically tells the
driver to create/capture a full frame and save to the given filename.
<snip 1>
Private Function capVideoFrameCallback(ByVal m_hWndC As Long, tVH As
VIDEOHDR) As Long
' this is where the callback occurs
' the pointers to the data are passed to where the frame is
processed
Dim obj As Object
'<TASK> @@@ capVideoFrameCallback mdlFrameCallback
' FLAGS
' VHDR_DONE Set by the device driver to indicate it is
finished with the data buffer and it is returning the buffer to the
application.
' VHDR_PREPARED Set by the system to indicate the data
buffer has been prepared with videoStreamPrepareHeader.
' VHDR_INQUEUE Set by the system to indicate the data
buffer is queued for playback.
' VHDR_KEYFRAME Set by the device driver to indicate a key
frame.
' Debug.Print "FLAGS = " & tVH.dwFlags
'
' Debug.Print "TIME = " & tVH.dwTimeCaptured ' Milliseconds from
start of stream
' Debug.Print "USER = " & tVH.dwUser ' User-defined data
'
' Debug.Print "BFRLEN = " & tVH.dwBufferLength
Set obj = GetCaptureClassByKey(m_hWndC)
If Not obj Is Nothing Then
fWebCam.FrameCallBack tVH.lpData, tVH.dwBytesUsed
End If
capVideoFrameCallback = 1
End Function 'capVideoFrameCallback
<snip 2>
' save the file
Call SendMessage(g_hCap, WM_CAP_FILE_SAVEDIB, 0&, ByVal
CStr(sDPName))