I am working with a framegrabber and need to get the images from computer memory and save them on an image file. after trying for couple of days I end up with the following 2 fu
I just find out I had a silly mistake in another part of my code I was using :
// Convert Image to bitmap and display it
DrawPicture( ghDCMain, pWinGBitmap, gpbImageData, lXSize, lYSize );
if(counter!=1) {
hBitmap2 = CreateCompatibleBitmap (hDCBits, lXSize, lYSize);
SaveToFile(hBitmap2, "c:\\t.bmp");
OutputDebugString("tested !!!!");
}
by deleting the hBitmap2 = CreateCompatibleBitmap (hDCBits, lXSize, lYSize);
line, and changing the hBitmap2 to hBitmap the result of CreateDIBSection(), it saved the image beautifully. THANK YOU EVERYONE FOR YOUR HELP.