PDA

View Full Version : saveToFileJPEG() Fuction Routine Error Question..



ilek
February 3, 2010, 09:07:51
Hi
I use Visual Studio 2008 and C++ MFC Programming.
I make some MFC Dialog base Program with save image function.
I make program base on Sample Code(In CD's).
and use VCD Simple file.
in the Dialog View add one button that is Capture.
and Insert code from website's example code that is
http://www.imagingcontrol.com/en_US/support/documentation/class/meth_descreffunctions_saveToFileJPEG.htm

Next is add button program part.
void CVCDSimpleDlg::OnBnClickedCapture()
{
// TODO:
m_Grabber.snapImages(1);
DShowLib::saveToFileJPEG(*m_Grabber.getActiveMemBu ffer(),"Testimage.jpg",75);

}
and press F5, Run Program, Select Devie , Image is right,
So I Press "Capture" Button and then...
as I Know the program is capture image and save "TestImage.jpg" File.
BUT....
Program Debugger stop and display Error Message.
I do not edit other part of the program, Just edit OnBnClickedCapture() part.
So I Request Some advice about programmig

1. How can i fix that Error. Please tell me how edit that program.

2. What is difference between isLive() and startLive()

Please Tell me..
and have a good day

Stefan Geissler
February 3, 2010, 10:10:51
Hello,

the error message would have been helpful. Please let me now the error message.
Maybe

DShowLib::saveToFileJPEG(m_Grabber->getActiveMemBu ffer(),"Testimage.jpg",75);

is better. I do not know, whether you implemented m_Grabber as pointer or not. If it is a pointer, use the "->" operator to access its members. If it is no pointer, use the "." operator. I do not recommend to use "*m_Grabber.".


The difference between startlive and islive is:
startlive starts the live video
isLive returns true, if the live video is running and returns false, if the live video is not running.
You may refer to:
http://www.imagingcontrol.com/en_US/support/documentation/class/meth_descGrabber_isLive.htm
and
http://www.imagingcontrol.com/en_US/support/documentation/class/meth_descGrabber_startLive.htm