- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
今天我开始移植创建的翻页示例 here适用于 Windows Phone 7 到 WinRT(XAML、C#)的帮助 this在 Stack Overflow 上发布的问题。但是在移植过程中,我被页面的剪辑部分卡住了。在 windows phone 示例中,他们使用路径几何裁剪来裁剪页面。但在 WinRT 中,似乎只有矩形几何图形支持裁剪选项。
如何在 WinRT 中实现类似路径几何裁剪的功能?
您可以从 here 下载示例 windows 电话代码
请找到我试过的源代码please download
在那请找到PageTurn.cs类,我在代码中评论了问题,在:
void left_PointerEntered(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
//_workingOdd.Clip = _oddClipRegion;
//_workingEven.Clip = _evenClipRegion;
}
最佳答案
希望这对您有所帮助。
这是 XAML,可准确获取您链接到的演示的外观:
路径计算
图片1
<Grid Background="Black">
<Grid Height="145" Width="210" >
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Margin="-3" BorderThickness="3" BorderBrush="White" Grid.ColumnSpan="2"></Border>
<Image Grid.Column="0" Source="Images/1.jpg"></Image>
<Image Grid.Column="1" Source="Images/2.jpg" ></Image>
<Image Grid.Column="1" HorizontalAlignment="Left" Source="Images/8.jpg" >
<Image.Clip>
<RectangleGeometry Rect="0,0,49,150"></RectangleGeometry>
</Image.Clip>
</Image>
<Path Grid.ColumnSpan="2" Data="M 180,0 L 153,145 L 85 120 L 160,-12" >
<Path.Fill>
<ImageBrush ImageSource="Images/4.jpg"/>
</Path.Fill>
</Path>
<!--polyline used for path image border-->
<Polyline Points="180,0,160,-11,85,120,153,145" Margin="0,-2,0,0" Stroke="White" StrokeThickness="3" Grid.ColumnSpan="2"/>
</Grid>
</Grid>
<Grid Background="Black">
<Grid Width="290" Height="180" >
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderThickness="2,0,0,0" BorderBrush="White">
<Image Stretch="Fill" Source="Images/4.jpg"></Image>
</Border>
<Image Grid.Column="1" Source="Images/3.jpg" ></Image>
<Path Grid.ColumnSpan="2" Data="M 200,0 L 170,180 L 82.5 160 L 130 0 " >
<Path.Fill>
<ImageBrush ImageSource="Images/6.jpg"/>
</Path.Fill>
</Path>
<!--polyline used for path image border-->
<Polyline Points="130,0,82.5,160,170,180" Stroke="White" StrokeThickness="2" Grid.ColumnSpan="2"/>
</Grid>
</Grid>
<Viewbox Width="500" Height="350">
<Grid Width="290" Height="180"/>
</Viewbox>
关于windows-8 - WinRT 中等效的路径几何裁剪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22905589/
是否可以在 WinRT 中实现自定义转换?例如。如果能够实现控件可见性的转换,那就太好了。因此,当您显示/隐藏分割 View 的一部分时,它会使用滑动效果为整个 View 添加动画效果。 最佳答案 是
我正在开发基于 XAML C# 的通用应用程序(目前专注于 WP8.1) 我的应用程序的主页非常复杂,有 3 个枢轴,每个枢轴都有网格、图像、边框、按钮、 ListView 等 问题有时是当我在执行其
我不久前从 C++/CX 切换到 C++/winrt,目前我被卡住了,因为我想创建一个单例 winrt 类。我阅读了有关 winrt::static_lifetime ( https://learn.
与 C++/CX 不同,C++/WinRT 中似乎没有 GUID 的包装器类型。它只使用普通的 C GUID struct原样。因此构造初始化 GUID 的唯一方法是使用 aggregate init
文档显示了这个 C# 片段: async void DisplayDeleteFileDialog(){ ContentDialog deleteFileDialog = new Conten
文档显示了这个 C# 片段: async void DisplayDeleteFileDialog(){ ContentDialog deleteFileDialog = new Conten
这是 xaml 的样子:
我有一个文本框,我不希望用户粘贴到其中。 如何防止粘贴? 从另一个应用程序中将文本拖放到 TextBox 中也是一个粘贴事件吗? 最佳答案 从 Windows 8.1 开始,Windows.UI.XA
这实际上更像是一个好奇心类型的问题。我负责跨程序集和原始 IL 查找类型。不过,Windows 8 确实让我正在实现的某些事情陷入困境。我发现 WinRT 和非 WinRT 框架程序集共享相同的完全限
我正在尝试创建一个条目页面,其中一个选项是选择一个项目。该列表可以超过 1000 个,并且显示列出项目的启用搜索的页面是有意义的。当用户从编辑/创建屏幕中单击“选择项目”时,我可以将导航参数传递到该屏
我正在将我的库移植到 WinRT,它依赖于 System.Globalization.Calendar 类及其派生类,如 GregorianCalendar 和 HijriCalendar 等。虽然这
我需要下载一个大的视频文件并将其保存到硬盘上。 然后我需要使用 XAML 媒体元素播放这个视频文件。 但该文件必须使用 AES 256 算法和加密 key 进行加密。任何时候都不得将未加密的数据写入硬
假设我有这样的事情: 像这样: public class MyViewModel : INotifyPropertyChanged { public MyViewModel() {
我正在尝试使用 WinRT 中的当前文化来格式化日期时间值。但是CurrentCulture 属性似乎并不尊重系统文化。 我尝试了以下两个属性, System.Globalization.Cultur
我的应用程序是在 silverlight 中开发的。计划在今年晚些时候推出。我担心我的 xaps 会被逆向工程。我的 wcf 服务确实有很多智能,但您不能将所有内容都放在服务中。现在 winrt 是另
我使用下面的代码发送电子邮件。但是当我在 VS 的模拟器中运行它时,无法启动电子邮件客户端。我做错了什么?但是电子邮件客户端以本地计算机模式启动。 var mailto = new Uri("mail
我正在开发通用应用程序。在为Windows Phone 8.1项目设计 View 时,不能使任何按钮的宽度小于109。如果将按钮的width属性设置为小于该宽度,则呈现时它将变为109。 我想知道如何
情况: 我从不同的互联网位置获取 json 对象。 这些包含我放在 BingMap 上的许多地理坐标。效果非常好。 问题: 但是当我从互联网位置获取数据时,我得到了一个阻塞的用户界面。有没有办法在后台
想法是这样的,您正在 Visual Studio 2013 Update 2 中为 Windows 8.1-Update 和 Windows Phone 8.1 创建一个 WinRT-XAML 通用应
什么是更新(替换)本地存储中的图像的好方法,该图像绑定(bind)到导航堆栈中的图像控件。 更具体地说:我在页面 A (ViewProfile.xaml) 中显示图像,图像源绑定(bind)到属性 I
我是一名优秀的程序员,十分优秀!