カスタムフォームにネイティブカメラアプリを埋め込みたい。カメラを埋め込みたい RECT r プロパティは次のとおりです。
r.top = 26; r.bottom = 220; r.左= 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に表示する方法を知っている人はいますか?