网格拆分器重叠 [英] Grid Splitter Overlap

查看:23
本文介绍了网格拆分器重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建重叠"效果(因为没有更好的术语).将有一个拆分器,当移动时,它会显示两个相似图像的不同视图(例如在彩色和灰度之间).

I'm trying to create an "overlap" effect (for lack of a better term). There will be a splitter that when moved, exposes a different view of two similar images (e.g. between colored and grayscale).

我计划使用 WinRTXAMLToolkit 中的 CustomGridSplitter(因为 WinRT 没有拆分器).我正在考虑从类似于以下的网格开始:

I plan on using CustomGridSplitter from WinRTXAMLToolkit (due to WinRT's lack of a splitter). I'm thinking of starting with a grid similar to:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition Height="10" />
        <RowDefinition />
    </Grid.RowDefinitions>
    <controls:CustomGridSplitter Grid.Row="1" Opacity="0.25"/>
</Grid>

...但我不知道如何继续.如果我在第一行和第三行(或列)上指定两个图像控件,如何防止图像控件移动(左右)?另外,是否可以对角地进行此操作?

... but I'm not sure how to proceed. If I specify two image controls on the first and third row (or column), how do prevent the image controls from moving (or so)? Also, is it possible to do this diagonally?

推荐答案

您可以使用两个使用 ImageBrush 的 Rectangles 或两个使用 Clip 属性来剪辑其内容的 Image 控件.不幸的是,在 WinRT 中不能有对角线剪辑,只有矩形剪辑.也许您可以检查将多个 RotateTransforms 与 Clip 组合是否可行,您永远不知道.除了上面的内容,我会在您的场景中使用 Slider 而不是 GridSplitter.

You could use two Rectangles that use an ImageBrush or two Image controls that use a Clip property to clip their contents. Unfortunately you can't have diagonal clips in WinRT, only rectangular ones. Maybe you could check if combining multiple RotateTransforms with a Clip would work, you never know. Other than above I would use a Slider instead of a GridSplitter for your scenario.

这篇关于网格拆分器重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆