|
我的programming可以拍影像,然后储存进memory buffer1 with image format from webcam.
how i write programming code that can save image to file?就是写c++里的microsoft foundation class(MFC)篇码关于可以储存进我的文件夹!
以下是我的programming code
long lHeadSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
//First image
m_cVideo2.SetCameraPropertyLong(PROPERTY_LED, LED_OFF); //set camera LED off
::Sleep(50); //wait for 200 ms(time interval)
char* pBuffer1_hd;
char* pBuffer1;
long lSize;
m_cVideo2.PictureToMemory(0, 24, NULL, &lSize, NULL );// get buffer size
pBuffer1_hd = (char*) malloc(lSize); // allocate buffer
if(pBuffer1_hd)
{
m_cVideo2.PictureToMemory(0, 24, (long)pBuffer1_hd, &lSize, NULL ); //take image
long W, H, B, F;
m_cVideo2.GetVideoFormat(&W, &H, &B, &F);//
pBuffer1 = pBuffer1_hd + lHeadSize; // allocate buffer
} |
|