HRESULT hReturn;
SHCAMERACAPTURE shcc;
//SetWindowPos(this,20,20,176,144,SWP_SHOWWINDOW);
ZeroMemory(&shcc, sizeof(shcc));
shcc.cbSize = sizeof(shcc);
shcc.hwndOwner = NULL;
shcc.pszInitialDir = L"//Application Data//";
shcc.pszDefaultFileName = L"dd.jpg";
shcc.pszTitle = L"dsfsdafdasf";
shcc.StillQuality = CAMERACAPTURE_STILLQUALITY_DEFAULT ;
shcc.VideoTypes = CAMERACAPTURE_VIDEOTYPE_ALL;
shcc.nResolutionWidth = 176;//GetSystemMetrics(SM_CXSCREEN);
shcc.nResolutionHeight = 144;//GetSystemMetrics(SM_CYICON);
shcc.nVideoTimeLimit = 0;
shcc.Mode = CAMERACAPTURE_MODE_STILL ;
hReturn = SHCameraCapture(&shcc);
switch (hReturn)
{
case S_OK:
// The method completed successfully
break;
case S_FALSE:
// The user canceled the Camera Capture dialog box.
break;
case E_INVALIDARG:
// An invalid argument was specified.
break;
case E_OUTOFMEMORY:
// There is not enough memory to save the image or video.
break;
default:
// An unknown error occurred.
break;
}
return;
wince下高级API调用Camer
最新推荐文章于 2017-11-08 18:31:00 发布
本文介绍了一个使用SHCameraCapture API进行拍照的例子。代码展示了如何设置摄像头捕捉对话框的各种参数,如文件保存路径、默认文件名等,并通过switch语句处理了不同返回值的情况。

1231

被折叠的 条评论
为什么被折叠?



