Creating a bitmap viewer in Visual C++
-
Does anyone know of a sample MS Visual C++ program that takes raw black and white video data (saved as a binary file) that is transmitted at 3 frames/sec and shows them on the screen at the same rate? if not, is there an article that explains how to do this in Visual C++? thanks in advance. -- modified at 10:10 Wednesday 2nd August, 2006
Kitty5
-
Does anyone know of a sample MS Visual C++ program that takes raw black and white video data (saved as a binary file) that is transmitted at 3 frames/sec and shows them on the screen at the same rate? if not, is there an article that explains how to do this in Visual C++? thanks in advance. -- modified at 10:10 Wednesday 2nd August, 2006
Kitty5
See Displaying a JPG in your MFC Application[^] Seems you can control the frame rate manually by extracting each of your frames from the movie data.
SaRath.
_"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
-
Does anyone know of a sample MS Visual C++ program that takes raw black and white video data (saved as a binary file) that is transmitted at 3 frames/sec and shows them on the screen at the same rate? if not, is there an article that explains how to do this in Visual C++? thanks in advance. -- modified at 10:10 Wednesday 2nd August, 2006
Kitty5
If (1) your "black & white video data" is actually "8-bit grey-scale" (which is what one might expect from a video camera), and (2) the image size is fixed (number of pixels horizontal & vertical is known), it could be quite easy.
Create a window to use to display the images
Create a bitmap header.
Set the bitmap parameters (number pixels X & Y, pixel depth, not using pallette, etc)
Read the binary file into some area in memory
Set the bitmap header "data" parameter to point to your data
Use SetDIBitsToDevice to display it in your window.
Repeat the last 3 steps until stoppedIf the video has unusual attributes (for example, it is 12-bit greyscale from a medical imager, or if it is in columns not rows) you will probably need an intermediate step, to create a bitmap which Windows understands.