我想将本机相机应用程序嵌入到自定义表单中。我要嵌入相机的 RECT r 属性如下:
r.top = 26; r.bottom = 220; r.left = 0; r.right = 320;
这是运行本机相机应用程序的方法:
HRESULT CPhotoCapture::CameraCapture(HWND hwndOwner, LPTSTR pszFilename) { HRESULT hResult; SHCAMERACAPTURE shcc;
//Set the SHCAMERACAPTURE structure
ZeroMemory(&shcc, sizeof(shcc));
shcc.cbSize = sizeof(shcc);
shcc.hwndOwner = hwndOwner;
shcc.pszInitialDir = _T("\\My Documents");
shcc.pszDefaultFileName = _T("test.jpg");
shcc.pszTitle = _T("Camera Demo");
shcc.StillQuality = CAMERACAPTURE_STILLQUALITY_HIGH;
shcc.VideoTypes = CAMERACAPTURE_VIDEOTYPE_MESSAGING;
shcc.nResolutionWidth = 1024;
shcc.nResolutionHeight = 768;
shcc.nVideoTimeLimit = 15;
shcc.Mode = CAMERACAPTURE_MODE_STILL;
//display the camera capture dialog
hResult = SHCameraCapture(&shcc);
if(hResult == S_OK)
{
//TODO:: Write to log
}
return hResult;
}
上面的方法是从尺寸等于 r 的窗口调用的:
HRESULT hr = S_OK;
hr = m_PhotoCapture.CameraCapture(this->m_hWnd, L"test");
有谁知道如何修改上述函数(hwndOwner)在矩形r中显示嵌入资源的方式?