2012-04-03 9 views
0

Windows 8がインストールされたタブレットがあり、Metroアプリケーションを作成したいと思います。 私は、正面と背面を向いているカメラを持っています。これらのソースのいずれかのカメラストリームをSilverlightの四角形に描画したいと思います。 Windows Phone 7の場合は、VideoBrushRectangle)でそれを行うことができます。 Windows 8ではどのように動作しますか?Silverlightコントロールにカメラのストリームを描画するには - Metro&Windows 8

<CaptureElement x:Name="captureElement"/>:私の問題の答えはこうです

: 私はごめんなさいCameraCaptureUIクラス

答えて

0

と一緒に写真を作る話ではない、私はちょうど同様の質問/答えhereを見つけました

async private void StartCamPrev() 
{ 
    var mediaCapture = new Windows.Media.Capture.MediaCapture(); 
    await mediaCapture.InitializeAsync(); 
    this.captureElement.Source = mediaCapture; 
    await mediaCapture.StartPreviewAsync(); 
} 

そして、前面/背面カメラについての答え私はhereが見つかりました:

DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture); 
var mediaCapture = new Windows.Media.Capture.MediaCapture(); 
await mediaCapture.InitializeAsync(new MediaCaptureInitializationSettings 
{ 
    // the index of the devices-array is defining the device 
    // here I just put a '0' for testing-purposes: 
    VideoDeviceId = devices[0].Id 
}); 
関連する問題