PDA

View Full Version : How can show the last snape picture after stopLibe() ???



webmice
April 12, 2004, 18:54:40
After stopLive() , I wan to show the last snape picture in the winow ??

Stefan Geissler
April 13, 2004, 08:31:12
Hello,

You can find a matching sample in the demoapp sample.

Before you call stopLive() call snapImages() as shown in the CmainFrame::OnPreviewStop() method in Mainframe.cpp.

You can display the snapped image as shown in the CChildView::OnPaint() method in Childview.cpp.

webmice
April 21, 2004, 20:57:36
I live the video in Zoom out 480 x 360 when I snap it & show the picture , why the image show as the width of the live image & zoom in as 640 x 480 ?? How Can I fix this problem ????

Stefan Geissler
April 22, 2004, 07:29:17
Hello Webmice,

have a look on the function StrecthDIBits() in MSDN to solve your problem.

webmice
May 6, 2004, 20:45:38
after modify the code as follow for zoom out

int nLines = StretchDIBits(hDC,// Handle to the device
0, // x-coord of destination upper-left corner
0, // y-coord of destination upper-left corner
480, // width of destination rectangle
360, // height of destination rectangle
0, // x-coord of source upper-left corner
0,// y-coord of source upper-left corner
pInf->biWidth, // Source rectangle width
pInf->biHeight, // Source rectangle height
pBuffer->getPtr(), // Modified address of array with DIB bits0, // First scan line in array
reinterpret_cast<LPBITMAPINFO>( &*pInf ),
DIB_RGB_COLORS,// RGB or palette indices
SRCCOPY
);

the quality of the image is too bad !!!

How can i make it better ??

Stefan Geissler
May 7, 2004, 12:59:00
int SetStretchBltMode(
HDC hdc, // handle to device context
int iStretchMode // bitmap stretching mode
);


Call this function before the StretchDIBits().