将像素着色器限制在图像的特定区域

发布于 2024-09-14 04:36:01 字数 43 浏览 2 评论 0原文

有什么方法可以限制像素着色器在图像的特定区域上。

BR

Is there any way to restrict Pixel shader on particular area of image.

BR

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情独悲 2024-09-21 04:36:01

绘制一个布局(网格、画布等),使一个或多个单元格包含受限区域。然后在该特定区域上绘制矩形或边框控件以获得您想要的效果。请记住首先添加矩形,或者使用 ZIndex,如下所示,这样您的代码就不会隐藏任何控件。

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Rectangle Grid.Column="0" Grid.Row="1" Panel.ZIndex="0" >
        <Rectangle.Style>
            <Style TargetType="{x:Type Rectangle}">
                <Setter Property="Fill" Value="Blue"/>
            </Style>
        </Rectangle.Style>
    </Rectangle >
    <TextBox Grid.Column="0" Grid.Row="1" Height="25" Margin="10" Text="Test 123" Panel.ZIndex="1" />
</Grid>

Draw a layout (Grid, Canvas etc.), so that one or more cells contain the restricted area. Then draw a Rectangle or Border control on that particular area to get the desired effect you are looking for. Remember to add the Rectangle first, or play with ZIndex as I show below so that your code does not hide any controls.

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Rectangle Grid.Column="0" Grid.Row="1" Panel.ZIndex="0" >
        <Rectangle.Style>
            <Style TargetType="{x:Type Rectangle}">
                <Setter Property="Fill" Value="Blue"/>
            </Style>
        </Rectangle.Style>
    </Rectangle >
    <TextBox Grid.Column="0" Grid.Row="1" Height="25" Margin="10" Text="Test 123" Panel.ZIndex="1" />
</Grid>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文