WPF 控制翻转
我有一个主要由图像和按钮组成的控件。我想在图像背面显示图像元数据,并在按下按钮时让控件水平翻转:
即
单击“信息”按钮...
将图像绕轴旋转 180 度...
显示带有元数据(或任何实际数据)的图像“背面”。
显然,当单击红色“关闭”按钮时,图像会旋转最后 180 度,以便再次显示图像。
我没有在 XAML 中真正做过任何 3D,但我不明白为什么这会太复杂......
I've got a control that is mainly comprised of an image and a button. I want to display the image meta data on the back of the image and have the control flip horizontally when the button is pressed:
i.e.
Click the "info" button...
Rotate the image 180 degs around the axis...
Show "back" of image with meta data (or whatever really).
Obviously when the red "close" button is clicked, the image rotates around the final 180 degs so that the image is showing again.
I've not done any 3D really in XAML, but I can't see why this would be too complex...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
无需 3D 即可完成。将水平比例从
1
更改为-1
的ScaleEffect
具有相同的视觉效果:您可以将
ScaleX
属性设置为动画获得旋转效果。您还应该将其可见性从Visible
更改为Hidden
,反之亦然。使图像旋转90度后消失。同时后面板应该变得可见。It can be done without 3D.
ScaleEffect
with changing horizontal scale from1
to-1
has the same visual effect:You can animate
ScaleX
property to get rotating effect. You should also change it's Viisibility fromVisible
toHidden
and vice versa. To make image disappearing after rotating 90 degrees. At the same time back panel should become visible.可翻转的 UserControl:
使用示例:
A UserControl which is flippable:
Usage example:
我知道旧帖子,但看看 http://thriple.codeplex.com/
Josh smith 提供了早在 2009 年就做到了这一点的控件。
old post I know, but take a look at http://thriple.codeplex.com/
Josh smith provided a control that did this back in 2009.
有一个 看看这个项目。
我正在等待 Silverlight 的平面投影出现在 WPF 中。
Have a look at this project.
I am waiting for Silverlight's plane projections coming to WPF.
您可以使用此博客中的想法,该博客展示了如何在 Silverlight 中执行此操作。如果我们使用 ViewPort3D 而不是 Projection,那么在 WPF 中几乎同样可以工作
http://jobijoy.blogspot.com/2009 /04/3d-flipper-control-using-silverlight-30.html
You can use the idea from this blog which shows how to do it in Silverlight. Pretty much same will work in WPF if we use ViewPort3D instead of Projection
http://jobijoy.blogspot.com/2009/04/3d-flipper-control-using-silverlight-30.html