如何使用 Webview2.Effect

问题描述

背景:我们使用投影仪来显示我们的应用程序。投影仪可以像显示器一样使用。然而,投影仪会引起失真,这些失真可以使用几何扭曲进行校正。我们使用 WPF 中 UIElement 类提供的 Shader 属性创建着色器,以进行几何校正扭曲。我们可以处理所有这些。

问题:投影仪屏幕上的所有 UIElement 视觉效果都得到了正确修正——WebView2 UIElement 除外。我得出的结论是 WebView2 类的 Effect 属性不起作用。

这个作品:(没有 Webview2)

 <Grid>   
        <Rectangle  x:Name="Grid0" Height="800" Width="1280">
            <Rectangle.Fill>
                <ImageBrush x:Name="ProjectorLut" />
            </Rectangle.Fill>
        
        </Rectangle>

        <Canvas Height="800" Width="1280" >
      
            <Image ImageSource="BoundToRenderBitmpapSource"  Height="800" Width="1280"/>
 
            <Canvas.Effect>
                <local:CalibrationEffect>
                    <local:CalibrationEffect.Input2>
                        <VisualBrush Visual="{Binding ElementName=Grid0}" />
                    </local:CalibrationEffect.Input2>
                </local:CalibrationEffect>
            </Canvas.Effect>
      </Canvas>
</Grid>

这行不通

 <Grid>   
        <Rectangle  x:Name="Grid0" Height="800" Width="1280">
            <Rectangle.Fill>
                <ImageBrush x:Name="ProjectorLut" />
            </Rectangle.Fill>
        </Rectangle>
        <Canvas Height="800" Width="1280" >
      
            <wv2:WebView2 Name="webView"  Source="https://earth.google.com" Height="800" Width="1280" >
            </wv2:WebView2>
           
            <Canvas.Effect>
                <local:CalibrationEffect>
                    <local:CalibrationEffect.Input2>
                        <VisualBrush Visual="{Binding ElementName=Grid0}" />
                    </local:CalibrationEffect.Input2>
                </local:CalibrationEffect>
            </Canvas.Effect>
     </Canvas>
</Grid>

所以我尝试了一些不同的东西。我将 WebView2 的 XAML 代码替换为绑定到 rendertargetBitmap 生成的图像源的图像类,该图像源通过在后面的代码中创建 rendertargetBitmap 图像源来呈现。这对我也不起作用。

问题:我如何以不同的方式看待这个问题,或者我是否正在做一些我需要更深入地研究的事情?

我正在使用 Desptop WPF,感谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...