Wednesday, June 29, 2011
Using Camera API with only Embedded Visual C++ 4.0 (evc4): Sample code and EVC4 workspace download
Using Camera API with only Embedded Visual C++ 4.0 (evc4): Sample code and EVC4 workspace downloadIn my previous post, I talked about how to use the new Camera API in Windows Mobile 5.0 SDK with only Embedded Visual C++ 4.0 (evc4).You can download the EVC4 workspace here. The source code is written based on the MSDN documentation on SHCameraCapture, which states: Application writers should be aware that SHCameraCapture function can cause the calling application to stop responding in cases where the calling application is minimized and then reactivated while the call to SHCameraCapture function is still blocking.The sample code is written by copying the snippets in that MSDN documentation, although I do not really find such "stop responding" mischief using the "possible sequence of events". The program shows "Capture" and "Exit" in the bottom menu bar. Clicking the left soft key launches the camera capture dialog. After clicking the Action key, the program captures videos for 15 seconds then ask for a place to save the video file.Two gotchas: The MSDN documentation says the window class of camera capture dialog is "Camera View". In my Sprint PPC6700 device, the class name is actually "WCE_IA_Camera_Main" (read the source code for a comment). The camera capture dialog still shows even after the program is closed. The function "CloseCameraDialog" is used to close it before the program shuts down (read the source code for details) BTW, the tool to find out the window class is Remote CE Spy. The default Remote CE Spy shipped with VS2005 does not work well with Windows Mobile 5.0 device. Read "Remote CE Spy shipped with Visual Studio 2005 fails to intercept windows messages" for a possible solution.
Labels:
android tutorial
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment