1
在我的應用我想表明從正面和背面攝像頭的視頻在拆分視圖:顯示的是從正面和背面攝像頭的視頻在Windows Phone的同時
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Canvas>
<Canvas.Background>
<VideoBrush x:Name="backBrush" />
</Canvas.Background>
</Canvas>
<Canvas Grid.Row="1">
<Canvas.Background>
<VideoBrush x:Name="frontBrush" />
</Canvas.Background>
</Canvas>
<Ellipse Fill="Red" Height="80" Width="80" Grid.RowSpan="2" />
</Grid>
在我的C#代碼,我設置源兩個攝像頭:
PhotoCamera frontCam;
PhotoCamera backCam;
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing))
{
frontCam = new Microsoft.Devices.PhotoCamera(CameraType.FrontFacing);
frontBrush.SetSource(frontCam);
}
if (PhotoCamera.IsCameraTypeSupported(CameraType.Primary))
{
backCam = new Microsoft.Devices.PhotoCamera(CameraType.Primary);
backBrush.SetSource(backCam);
}
}
的問題是,這兩個fronBrush.SetSource(frontCam);
和backBrush.SetSource(backCam);
被調用,但我只看到在頂部的背面攝像頭的視頻。當我改變這些命令的順序時,我看到另一臺攝像機的視頻。我嘗試了HTC 8X和模擬器。
它是某種約束,或錯誤的,還是我做錯了什麼?
我不相信這是可能與當前的API,而且我不認爲我已經看到在商店的應用程序,可以做到這一點(如Skype的)。 –
我看到一個應用程序做 – Jake