- 在显示监视器中连接 Miracast 设备
- 使用“CastingDevice.CreateCastingConnection()”创建与 Miracast 设备的连接
- 使用“castDeviceConnection.RequestStartCastingAsync()”使用 Miracast 设备进行投射请求
调用“RequestStartCastingAsync()”后显示设备配对消息框。有没有办法隐藏这些消息框?
示例代码:
//Create a new casting connection to the device that's been selected
castDeviceConnection = SelectedCastingDevice.CreateCastingConnection();
//Register for events
castDeviceConnection.ErrorOccurred += Connection_ErrorOccurred;
castDeviceConnection.StateChanged += Connection_StateChanged;
//casting test image
Image castImage = new Image();
castImage.Source = new Windows.UI.Xaml.Media.Imaging.BitmapImage
(new Uri(@"ms-appx:////Assets/test.jpg"));
CastingConnectionErrorStatus status = CastingConnectionErrorStatus.Unknown;
// Request for casting
castDeviceConnection.RequestStartCastingAsync( castImage.GetAsCastingSource());