【silverlight】手把手教你如何实现页面翻转效果

App Store 4.3被拒怎么办?从诊断到整改的完整避坑指南 在移动应用开发与上架流程中,App Store审核是开发者必须面对的关键环节。其中4.3条款因涉及“设计垃圾应用”判定,常让团队陷入反复被拒的困境。理解审核机制的基本原理,是规避风险的第一步——苹果会通过界面布局、代码结构、元数据等多维度识别重复或低质量应用。对于使用Flutter、React Native等跨平台框架的开发者而言,模板化代码与通用UI是触发4.3的高频因素。解决此类问题,需要从功能差异化、UI原创度、内容预置到审核备注进行系统性整改。掌握正确的诊断方法、提审节奏与申诉沟通技巧,不仅有助于通 阅读详情
 

The Secret Behind the Page Flip Technique



Two Flavors of Page Flip

The Page Flip technique has been around for several years in Flash. However, not all implementations are equal. Usually, the premium page flip components that are sold to developers are substantially different than the free page flip tutorials you might find online. The biggest difference is in the range of motion of the page corner being flipped. Most free page flip tutorials have a fixed radius motion path instead of a wider range of motion. In other words, no matter where you drag your mouse, the page corner will stay fixed to a curve as it travels from one side to the other. The math behind this technique is rather straightforward and variations of its implementation are found all over the place. The problem, though, is that the premium page flip technique allows a far greater range of motion while flipping the page (as shown above), which yields a much richer experience. However, nobody ever talks about how this one is done!

The Page Flip in Silverlight

So what we're going to do today is explain the mathematics behind a premium page flip experience engineered in Silverlight. The Silverlight implementation shown above was solved using trigonometry, clever masking and a little "smoke and mirrors" magic for the shadows. As with many of my blog posts, the effect can usually be split into the mechanics of the effect(the math part) and the presentation (the rendering tricks). Since Silverlight and Flash handle the mechanics of masking, clipping and rendering transforms differently, this tutorial is aimed primarily at Silverlight developers. However, the mathematical secrets behind the Page Flip technique are applicable to interactive developers in any language and this tutorial focuses primarily on explaining the rotational mechanics of the solution.

Step 1: Follow the Mouse, Constrain the Corner Point



[ Download BlogPageFlipStudy01.zip ]

PageFlipStudy01 sets up the framework for what we need to do. Please review it carefully, since the next 3 studies are built on top of each other. If you open it up, you'll notice the solution only has MainPage.xaml and a Dot.xaml control I created to visualize the solution variables so far. If you look over the MainPage.xaml.cs code, you'll see that the loaded() function mainly initializes variables and setups up the Mouse event handlers. All the logic happens in the CompositeTarget.Rendering() animation loop. Here are the key variables, as illustrated above:

M: The position of the Mouse as set by the MouseMove() event F: The mouse Follower that allows us to gracefully ease toward the raw mouse position C: The Constraint point which defines where the page corner will eventually be R1: The Radius point on the constraining circumference of the arc that defines the maximum page width allowed. SC: Spine Center SB: Spine Bottom EB: Edge Bottom

And here is the main constraint logic in the animation loop:



The most important variable at this point is our calculated constraint (dot C above). I never use the positional data from the Mouse events directly, but usually create a Follower variable that constantly eases toward the raw mouse position. However, for the page flip effect to work, the Constraint point that positions the page corner needs to respect the maximum width of the page. In other words, the line SB > C can never be longer than the line SB > EB .

Step 2: Adding the Second Constraint and Defining the Critical Triangle



[ Download BlogPageFlipStudy02.zip ]

In PageFlipStudy02 , we need to add an additional radius constraint R2 to define the maximum distance the page corner can be from the spine top (dot ST above). In other words, the line ST > C cannot be longer than the line that would connect ST and R2 . Here is the additional constraint code for the second constraining radius:



Now that the corner point C has been constrained between the two radii, we can get to the heart of the solution; the critical triangle. The critical triangle is creating by taking the bisector of line C > EB , which is marked by dot T0 . Shoot out a line perpendicular to the bisector toward the page bottom, and you get T2 . You then close up the triangle with T1 . This critical triangle will be used to control both the location and rotation of the Page object and the Rectangle that can serve as your clipping boundary. Here is the logic that calculates the tangent:



You may want to experiment with this skeleton and then experiment with the original page flip solution at the start of this article and see if you figure out how the properties of the critical triangle are used in a rendered solution.

Step 3: Adding the Page and Rotating the Corner



[ Download BlogPageFlipStudy03.zip ]

The biggest change in PageFlipStudy03 is the addition of a pageBack.xaml control that contains the page graphic we want to display. If you look at the control, you'll notice that both the positional and rotational point of the control is located at its bottom left corner. This makes sense, since when the page is finally flipped, the corner you're trying to flip is its bottom left corner. In MainPage.xaml.cs, the positioning and rotating of the page is calculated like so:



The important thing to realize is that the angle defined by T2 to C defines the amount of rotation needed for the page control if you anchor it to the constrained corner point C . You can determine the angle in Radians by performing a Math.atan2() operation on the variables shown above. Once you have this tangent value, you can set the page control's rotation angle to this value after converting it from Radians to Degrees (by multiplying by Math.PI/180.0), and the Page being flipped will always intersect with T2 .

Step 4: Defining the Clipping Region



[ Download BlogPageFlipStudy04.zip ]

Up to this point, you have all the logic required to constrain and rotate the page properly. The last essential step, however, is defining a clipping region that will also be animated to define what portion of the page should be visible during the flip. Since the focus of this tutorial is to understand the underlying math of the technique, though, I'll keep the rectangle visible so you can see exactly what is going on.

The red Rectangle above that can give me the points for a clipping path was created in such a way that it's renderTransformOrigin lines up to wherever T2 is. You calculate its position and rotation like so:



Inevitably, though, when you want to implement this solution, the red Rectangle object used above will need to be converted to a collection of Path figure segments within a PathGeometry that defines the clipping region for the page control (it's easier doing it this way than trying to perform a complex rotation on a clipping path, believe me). The good news is that Silverlight's GeneralTransform object makes this very easy:


That's it! The purple region above where the blue page and the red rectangle overlap defines how much of the page is visible as your flip it. Using the calculated points above, you can convert this rectangle to a proper pathGeometry that clips the page control, making it look like the page is being revealed by being flipped over. This trigonometry defines the mathematical underpinnings of the premium page flip effect. From here, you can use this structure to add your shadows and add multiple pages. Flipping from left to right is simply a reversal of the geometry and flipping from the top is a basic inversion. However, I'll leave it for you to add the shading and multiple page logic. Have fun!

StPageFlip:用于创建逼真的页面翻转效果的简单库 StPageFlip 强大,简单且灵活的JS库,可创建逼真的精美页面翻页效果。 产品特点 适用于画布上的简单图像和复杂HTML块 具有简单的API和灵活的配置 与移动设备兼容 支持横向和纵向屏幕模式 支持软页和硬页类型(仅在HTML模式下) 没有依赖关系 演示和文档: : 对于React.JS,您可以使用: ://nodlik.github.io/react-pageflip/ 文件(由TypeDoc产生): ://nodlik.github.io/StPageFlip/docs/index.html 安装 您可以使用npm安装最新版本: npm install page-f 立即下载

相关推荐

pageflip:翻书效果-翻页

pageflip 翻书效果-翻页 原地址: 示例地址: 硬封面示例:

StPageFlip:3分钟打造专业级Web翻页动画的终极指南

想要为你的网站添加令人惊艳的翻页效果吗?StPageFlip作为一款专为Web动画设计的轻量级库,能够将普通的数字内容转化为媲美真实书籍的沉浸式阅读体验。无论你是开发电子书阅读器、产品展示画册还是企业宣传手册,这个库都能让你的页面"活"起来。 ## 🌟 为什么选择StPageFlip? **性能卓越的动画引擎** StPageFlip基于TypeScript开发,充分利用现代浏览器的硬件加速

gitblog_00819的博客 762

flash翻书(fflippage)组件+源码+使用教程

flash翻书(fflippage)组件+源码+使用教程

打造沉浸式数字阅读体验:StPageFlip翻页效果库深度解析

在数字内容呈现日益重要的今天,如何让用户在屏幕上也能感受到纸质书籍的阅读乐趣?StPageFlip正是为此而生的强大JavaScript库,它能将传统的翻页体验完美移植到网页应用中,为电子书、在线杂志等数字出版物赋予生命。 ## 🌟 为什么选择StPageFlip? **逼真翻页效果** - 通过精细的数学计算和CSS3动画,StPageFlip模拟出纸张翻动时的自然弯曲和阴影变化,让每一次

gitblog_01016的博客 826

react-pageflip:用于StPageFlip库的简单React.js包装器,用于创建逼真的美观的页面翻转效果

版本2.0.0 此版本修复了一些错误,并完全使用react钩子编写。 !!! 方法访问API已更改!!! StPageFlip的React.js包装器 用于StPageFlip库的简单React.js包装器,用于创建逼真的美观的页面翻转效果 StPageFlip的功能 适用于画布上的简单图像和复杂HTML块 具有简单的API和灵活的配置 兼容移动设备 支持横向和纵向屏幕模式 支持软页和硬页类型(仅在HTML模式下) 没有依赖关系 带有源代码的实时演示: : StPageFlip的文档和示例: ://nodlik.github.io/StPageFlip/ 文件(由TypeDoc产生): ://nodlik.github.io/StPageFlip/docs/index.html 安装 您可以使用npm安装最新版本: npm install react-pageflip

vue 翻页组件vue-flip-page效果

主要介绍了vue 翻页组件vue-flip-page,本文通过实例代码给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下

silverlight控件实现立体翻转效果

      今天是星期六,一大早爬起来就开始着手写这个程序。刚到新公司不到三个个礼拜,公司的产品要求开发一个图表分析的功能,功能要求很有亮点,于是就考虑采用silverlight技术。由对silghtlight的无知到初步的会用,前前后后一共花了两个礼拜。对于这程序的关键代码还要感谢一下此博客的作者:http://www.bbniu.com/matrix/ShowApplication.aspx?id=122。      程序的功能说明:本程序主要是实现了两个图表控件向四个方向翻转的效果,具体程序可以下载。

xianhongdong的专栏 865

KTransformers安装笔记 利用docker安装KTransformers

KTransformers安装笔记 利用docker安装KTransformers

guoqingru0311的博客 1559

WP7-silverlight控件实现立体翻转效果

转自:http://blog.youkuaiyun.com/xianhongdong/article/details/5794897 今天是星期六,一大早爬起来就开始着手写这个程序。刚到新公司不到三个个礼拜,公司的产品要求开发一个图表分析的功能,功能要求很有亮点,于是就考虑采用silverlight技术。由对silghtlight的无知到初步的会用,前前后后一共花了两个礼拜。对于这程序的关键代码还要

Zhangh423的专栏 482

Mplus实战:随机截距交叉滞后模型(RI-CLPM)在心理学纵向研究中的进阶应用

本文深入探讨了随机截距交叉滞后模型(RI-CLPM)在心理学纵向研究中的进阶应用,通过Mplus实战演示了模型设定、结果解读及进阶建模策略。RI-CLPM能有效区分个体间差异和个体内变化,适用于追踪青少年手机使用与抑郁症状等研究。文章还提供了样本量规划、模型比较和结果可视化等实用技巧,助力研究者避免常见陷阱。

weixin_29220405的博客 369

面积二次矩second moment of area 极惯性矩polar moment of area 转动惯量moment of inertia面积一次矩first moment of area

看论文记录一下力学的名词专业术语,后面可以查看。

subtitle_的博客 5367

SilverLight实现绕垂直中线翻转效果

主要通过StoryBoard来控制PlaneProjection的RotationY来实现XAML: <Grid x:Name="LayoutRoot" Background="White" Height="Auto" Width="Auto"> <Grid.Resources> </Grid.Resources&gt...

andy930606的博客 94

HyperLynx(三十一)高速串行总线仿真(三)

(5)选择 “File”→ “Open Touchstone”,打开路径 C:\Adv_HL_Tmg\SERDES_Interface\models,选中connector.s4p,单击打开,如图所示。接下来,找出将要分配模型的S参数连接。(12)单击“Assign”按钮,选择模型类型为“Touchstone models”,在库中选择“connector.s4p”,如图所示。(14)单击“OK”按钮,选中“connector.s4p”这一行,单击“Connection Editor”按钮,如图所示。

小幽余生不加糖 3364

silverlight实现翻转效果

<br />请大侠帮下忙解决问题,在下感激不尽!在线等。。。<br />实现http://zion.earan.net/这个界面登录的翻转效果

a530445986的专栏 153

ransac拟合2D圆(三点定圆 c++详细版)

RANSAC(Random Sample Consensus,随机采样一致性)算法是一种基于随机采样的迭代算法,主要用于从一组包含大量噪声和异常值(外点)的数据中估计数学模型的参数。

twnkie的博客 1046

【教程4>第5章>第23节】基于FPGA的Gardner环实现——环路滤波器模块和Gardner环整体测试

1]黄凌.基于FPGA的QPSK全数字调制解调系统的设计与实现[D].南京航空航天大学[2025-02-02].DOI:10.7666/d.d166927.注意,这里包括一个NCO模块,一个内插模块,一个时偏误差检测模块,一个环路滤波器模块,在gardner环中,wk的反馈输入,变量为ww,从而构成了闭环。[4]李司.基于FPGA的数字接收机同步技术的研究与实现[D].北京交通大学[2025-02-02].DOI:10.7666/d.y1082455.:调整NCO的相位步长,控制采样时刻。

FPGA/MATLAB学习教程/源码/项目合作开发 853

silverlight程序,在多页面之间进行导航

问题背景: 类似ASP.NET的masterPage的形式,在父页A中,留有一块类似ASP.NET的ContentPlaceHolder的容器,这个容器里面,我们可以对子页B、C之间进行切换。 导航事件的触发按钮,我们写成用户控件形式,包含在子页B、C里面,点击这些按钮,要能触发父页的导航控件。 解决思路: 在程序集 System.Windows.Con...

weixin_30342209的博客 80

【LAMMPS学习】五、LAMMPS命令(8) Pair_style 势

所有LAMMPS pair_style命令如下表所示。有些样式有加速版本。这由括号中的附加字母表示:g = GPU, i = INTEL, k = KOKKOS, o = OPENMP, t = OPT。

荷塘阅色 3015

Silverlight——简单3D效果的探究

3D:  在MSDN上有个关于silverlight的3D展示,点击两边的图片时,图片转换会出先立体视觉动画效果:这个效果看上去很炫,但偏偏就这个实例MSDN上不给代码!郁闷啊。 立体感与3D:   既然没有那我就自己来。虽学习SL有段时间了,但多是在内部数据方面。虽然也看到过别人做出的3D效果的作品,但就觉的很炫,也就过过眼。既不知道如何实现这样的效果的,也没想过原理。偶然看到一张很让人纠...

weixin_30823683的博客 151

公开 学生课堂行为数据集 SCB-Dataset: A Dataset for Detecting Student and Teacher Classroom Behavior

公开 学生课堂行为数据集 SCB-Dataset Student Classroom Behavior dataset

CSPhD-winston的博客 1万+

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

silverlight控件翻转

旋转 my:KnifeSwitch Canvas.Left="430" Canvas.Top="82" Name="knifeSwitch1"                 my:KnifeSwitch.RenderTransform                     RotateTransform Angle="90"RotateTransform        

fengzheng22的专栏 695

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

Windows Phone下页面跳转动画的实现

写在前面的一些废话:   前段时间一直忙于其他的事情,好长时间没有更新博客,很多东西虽然看过、学过,但是没有仔细去思考,去总结,长时间不用或者用的少难免会遗忘。最近由于家里以及感情方面的事,人也变得有点怨天尤人,总给自己找各种各样的借口。趁这个国庆假期,好好的对之前的一些学习以及工作做一番总结。   用过Windows Phone的童鞋都会有这样的印象,动画效果不逊于小水果的,有...

ancong2859的博客 103

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

使用Silverlight 3 中的PlaneProjection实现3D效果

  Silverlight 3中加入许多新的特性,其中最令人激动的新特性之一就是Plane Projection,利用它可以使任何UIElement元素在3D空间中旋转,实现简单的3D旋转效果。下面是简单的实现一个图片在3D空间中沿着Y轴旋转的效果,当然只需要简单修改一下即可实现沿着X轴和Z轴旋转的效果。UserControl x:Class="PlaneProjDemo.MainPage"

1337

Silverlight Page Turning Made Simple [silverlight翻页实例 源码 原理 如何使用]

Wicked Code Silverlight Page Turning Made Simple Jeff Prosise Code download available at: WickedCode2008_05.exe (1110 KB) Browse the Code Online Contents The PageTurnDemo Applicatio

. 1272
上一篇: 【教程】垂直的3D滚轮菜单
下一篇: 【转贴-过滤】N款看上去很美的ECLIPSE插件
zinking3
博客等级 码龄20年 262粉丝 215原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值