Je souhaite intégrer l'application de caméra native dans un format personnalisé. Les propriétés RECT où je souhaite intégrer la caméra sont les suivantes:Comment repositionner/redimensionner la ressource sur l'écran?
r.top = 26; r.bottom = 220; r.left = 0; r.right = 320;
et c'est la méthode qui exécute l'application de la caméra natif:
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;
}
La méthode est appelé plus haut de la fenêtre dont les dimensions sont égales à r:
HRESULT hr = S_OK;
hr = m_PhotoCapture.CameraCapture(this->m_hWnd, L"test");
Est-ce que quelqu'un sait comment modifier la fonction ci-dessus (hwndOwner) la manière afficher la ressource incorporée dans le rectangle r?
Oui, j'ai une fenêtre enfant CCameraView et la méthode est appelée de la façon suivante: HRESULT hr = S_OK; hr = m_PhotoCapture.CameraCapture (this-> m_hWnd, L "test"); –