
larschrjensen
Denmark
Asked
— Edited

Has any one had success with setting up a camera stream and saving a snapshot to a file using c++?
This is what I have so far:
EZ_B::EZB ^ezb;
ezb = gcnew EZ_B::EZB("MyEZB");
EZ_B::Camera ^ezbCam;
ezbCam = gcnew EZ_B::Camera(ezb);
ezbCam->StartCamera(EZ_B::Camera::GetVideoCaptureDevices()[1], 320, 240);
ezbCam->SaveImageAsJPEG("c:\test.jpg");
I can confirm that the camera is on by running:
BOOL camOK = ezbCam->Camera::IsActive;
cout << "Camera on? " << camOK << "\n";
What am I missing here?
Best, Lars
Lars,
Are you using VS to compile & run the code or using cmake to compile and run the program in the command prompt ?
Cmake to generate the vs solution, after that vs to build and run
some guesses as usual ...
EZB relies on windows libraries, one of them is the System.Drawing, if not in your dll references, please add.
If is still not working, check the current bitmap and try to save:
c# code, convert to equivalent c++/cli:
let me know if you got success with any of the steps.
Can you post the content from the ezb log before the program ends?
Get it from this property...
DJ and ptp, I got caught up in something else and will be at a demo (with a few EZ-B's) all day tomorrow. I'll get back to you on sunday, monday at the latest. Thanks for you help so far!
Sounds good! Keep in touch!
Okay
@Sures: This is the output from GetLastErrorMsg:
Using this source:
@ptp: yes the System.Drawing dll is in the references.
So I tried this:
which compiles fine, but gives an unhandles exception and complains that object reference is not set to instance of an object at:
Thus, more or less the same error I get when running SaveAsJPEG.