时抛出尝试设置PhotoCamera作为源与代码的VideoBrush,当我得到上述错误:0x80131515启动相机
camera = new PhotoCamera();
var videoBrush = new VideoBrush();
videoBrush.SetSource(camera);
AR.Background = videoBrush;
我碰到下面的堆栈跟踪:
0x80131515
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.VideoBrush_SetExternalVideoSource(VideoBrush vb, IntPtr& videoSessionHandle)
at System.Windows.Media.VideoBrush.SetUpExternalVideoSession()
at Microsoft.Devices.CameraVideoBrushExtensions.SetSource(VideoBrush brush, Camera camera)
at MyClass.MyFunction()
at System.Windows.Controls.Frame.FireEventHandler[T](EventHandler`1 handler, Object sender, OrientationChangedEventArgs args)
at Microsoft.Phone.Controls.PhoneApplicationPage.UIOrientationChange(ShellPageOrientation orientation)
的无论是否附加调试器,都会引发异常。
谢谢。
我使用了CameraType.Primary。我认为我也可以使用编程创建的VideoBrush。神奇似乎在Thread.Sleep部分。而后台工作者似乎相当重要,为了不阻止用户界面。 – Kenn 2012-05-07 21:04:59