显示输入、EncoderDevice、WPF
我正在尝试通过 Microsoft.Expression.Encoder 流式传输输入设备,现在我可以在 WPF 中使用 WindowsFormsHost 显示它们,但对于其他事物(例如,AllowTransparency 属性等)总是有问题。
有没有什么方法可以在没有 WindowsFormsHost 的情况下显示它?
代码:(C#)
App.deviceSource.PreviewWindow = new PreviewWindow(new HandleRef(panel1, panel1.Handle));
XAML
<WindowsFormsHost x:Name="windowsFormsHost" Background="Black" Margin="12,12,12,59">
<wf:Panel Margin="0,0,0,0" x:Name="panel1" Size="836,600" />
</WindowsFormsHost>
I'm trying to stream input devices via Microsoft.Expression.Encoder and now I can display them with WindowsFormsHost in WPF but it is always problematic for other things such as, AllowTransparency property etc.
Is there any way to display it without WindowsFormsHost?
CODE: (C#)
App.deviceSource.PreviewWindow = new PreviewWindow(new HandleRef(panel1, panel1.Handle));
XAML
<WindowsFormsHost x:Name="windowsFormsHost" Background="Black" Margin="12,12,12,59">
<wf:Panel Margin="0,0,0,0" x:Name="panel1" Size="836,600" />
</WindowsFormsHost>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前没有 WindowsFormsHost 是没有办法的。
以下是使用 WindowsFormsHost 的 AllowTrasnparency 解决方法。阅读本文以了解透明度模式。还有一个示例解决方案:
http://blogs.msdn.com/b/changov/archive/2009/01/19/webbrowser-control-on-transparent-wpf-window.aspx
Currently there is no way without WindowsFormsHost.
Here is your workaround for AllowTrasnparency using a WindowsFormsHost. Read the article to be aware of the transparency modes. There is also a sample solution attached:
http://blogs.msdn.com/b/changov/archive/2009/01/19/webbrowser-control-on-transparent-wpf-window.aspx