2012-09-12 2 views

답변

1

PhotoCamera 개체를 사용해야합니다. 베스트과 같이 당신의 OnNavigatedTo에이 개체를 만들 수 있습니다 :

protected override void OnNavigatedTo (System.Windows.Navigation.NavigationEventArgs e) 
{ 
    if (PhotoCamera.IsCameraTypeSupported(CameraType.Primary) == true) 
    { 
     cam = new PhotoCamera(CameraType.Primary); 
     cam.CaptureImageAvailable += new EventHandler<Microsoft.Devices.ContentReadyEventArgs>(cam_CaptureImageAvailable); 
     viewfinderBrush.SetSource(cam); 
    } 
    else 
    { 
     txtMessage.Text = "A Camera is not available on this device."; } 
    } 
} 
// dispose when we leave 
protected override void OnNavigatingFrom (System.Windows.Navigation.NavigatingCancelEventArgs e) 
{ 
    if (cam != null) 
    { 
     cam.Dispose(); 
    } 
} 

은 실제로 당신이 다음 캠 객체에 방법 CaptureImage를 호출 할 수 있습니다 카메라에서 이미지를 촬영합니다.

관련 문제