翻书的效果:FMX.TSwipeTransitionEffect Animation
This example shows how to use a TSwipeTransitionEffect transition and a TPathAnimation to simulate the turning of a book page.
- 1. To build and test this example, create a HD FireMonkey Application - Delphi, then add the next objects to the form:
- A TImage.
- A TSwipeTransitionEffect as a child of the TImage.
- A TSelectionPoint.
- A TPathAnimation as a child of the TSelectionPoint.
- 2. Load a bitmap to the TImage and select the Target and Back bitmaps for the TSwipeTransitionEffect.
- 3. Add the following code to the OnClick event handlers of the image:
Code
procedure TForm1.Image1Click(Sender: TObject);
begin
PathAnimation1.Enabled := False;
SelectionPoint1.Position.Point := PointF(0,0);
SelectionPoint1.Opacity := 0;
PathAnimation1.Parent := SelectionPoint1;
PathAnimation1.Path.Clear;
// begin Path for mouse pointer
PathAnimation1.Path.MoveTo(PointF(0,0));
PathAnimation1.Path.LineTo(PointF(Form1.Width/2,Form1.Height/2));
PathAnimation1.Path.LineTo(PointF(Form1.Width*2,0));
// end
PathAnimation1.Duration := 2;
PathAnimation1.Start;
end;
- 4. Add the following code to the OnFinish and OnProcess event handlers of the TPathAnimation:
Code
procedure TForm1.PathAnimation1Finish(Sender: TObject);
var
BitMap : TBitmap;
begin
BitMap := TBitmap.Create(0,0);
BitMap.Assign(SwipeTransitionEffect1.Target);
SwipeTransitionEffect1.Target := Image1.Bitmap;
Image1.Bitmap.Assign(BitMap);
SwipeTransitionEffect1.MousePoint := PointF(0,0);
end;
procedure TForm1.PathAnimation1Process(Sender: TObject);
begin
SwipeTransitionEffect1.MousePoint:=SelectionPoint1.Position.Point;
end;
The image will swipe its bitmap on every mouse click. The next image shows the resulting animation:

http://docwiki.embarcadero.com/CodeExamples/XE6/en/FMX.TSwipeTransitionEffect_Animation
翻书的效果:FMX.TSwipeTransitionEffect Animation的更多相关文章
- [知了堂学习笔记]_css3特效第一篇--旋转的背景&翻书效果
一.html遮盖层与css3的旋转动画 >效果图(加载可能会慢一点儿,请稍等...): >实现思路:在一个大的div中装入一个底层img和顶层的div(里面的内容按照以上图片呈现的样式布局 ...
- css3特效第一篇--旋转的背景&翻书效果
一.html遮盖层与css3的旋转动画 >效果图(加载可能会慢一点儿,请稍等...): >实现思路:在一个大的div中装入一个底层img和顶层的div(里面的内容按照以上图片呈现的样式布局 ...
- Andorid 翻书效果
本文内容 项目结构 环境 演示 参考资料 翻书效果,主要采用绘制贝塞尔曲线的方法.本文有三个演示: 简单翻书效果.翻下一页后,当前页不会消失. 翻书时的贝塞尔曲线.演示翻书时,贝塞尔曲线的路径和要素. ...
- CSS3、jQuery实现3D翻书动画
使用CSS3 ,jQuery实现点击翻书动画效果,完整效果可在firefox中查看 HTML <div class="desktop"> <div class=& ...
- PPT中翻书动画的制作
一.新建一个空白的PowerPoint文档. 二.制作两个页面: 1.点击“自选图形”右边的小三角,选择“基本图形”下的“折角形”图形,在PowerPoint中画出一个书页样的图形,宽度最好小 ...
- 基于CSS3新属性Animation及transform实现类似翻书效果
注:本实例JS部分均以原生JS编写,不善用原生JS的,可用jQuery等对三方框架改写 先上效果图:(样式有点丑,可以忽略一下下,效果出来了就好,后期加到其他项目中方便更改0.0) 类似翻书效果,原本 ...
- 纯css实现翻书效果
前言 最近研究了一下css3的3D效果,写了几个demo,写篇博客总结一下实现的经过.PS:如果对transform-origin/perspective/transform-style这些概念还不了 ...
- turn.js实现翻书效果
JS插件网 http://www.ijquery.cn/?p=173 描述:Turn.js 是一个轻量级的 (15kb) jQuery/html5 插件用来创建类似书本和杂志翻页效果,支持触摸屏设备. ...
- Unity3d:megaFierstext(翻书效果插件)
附件中是一款翻书效果插件,由于附件上传大小限制,在下载完后,需要在megaFierstext_BHYF\Assets\Resources\Textures下添加图片精灵并修改属性为Texture,即可 ...
随机推荐
- Android studio Debug效率提升
Android studio Debug效率提升,可以在控制台打印log的同时而不暂停程序的运行,尤其是当遇到复杂交互的时候,比如滑动,拖动,这时候程序暂停执行是特别恶心的.其实你可以更新打印信息而不 ...
- ssh username@10.2.1.23无法连接
ssh username@10.2.1.23无法连接 经过排查各种openSSH版本等,最终因为两个机器不是一个段(A:255.255.0.0 B:255.255.255.0)造成的. 关于IP需要以 ...
- 比较常见的const与指针的组合情况
1.对于普通的const与基本类型组合,都是表示的是这是一个常量, const int a; int const a; 表示的意思是一样的,a是一个常量,不可改变 2.对于const与指针组合在一起, ...
- Azure File SMB3.0文件共享服务(3)
在Windows上使用Azure文件共享服务 之前简单介绍过,你可以通过SMB 3.0协议,将Azure文件共享挂载在本地,就如使用一个网络驱动器是一样的,但需要注意不同版本的Windows对于SMB ...
- 微软云基础架构Hyper-scale Datacenter
每天醒来,可能很多人的习惯都是打开手机,看看微信,刷刷朋友圈,或者看看新闻,去咖啡店,打开电脑搜索一些关键字,观看视频,电视剧--可是你有没有想过你每一次键盘的敲击,每一次微信的语音的发送,数据会流向 ...
- 定义不同版本的jQuery
<script type="text/javascript" src="/js/jquery-2.0.3.min.js"></script&g ...
- PHP转码函数
解决中文乱码问题,数据库使用sql server ,是gbk编码,所以在存储和前台显示时都要转码. function cn_convert2web($str){ return iconv('gbk', ...
- PyCharm设置字体
pycharm 是很好的一个IDE,就是默认字体太小了,真的太小了,改字体的地方很隐晦.找了半天,贴图: 然后发现size 不能更改,所以,点击save as创建一个方案,然后修改自己的方案.这个时候 ...
- poj 3026 (最小生成树)
题意:起点开始有超过100个人,总共不会超过100个外星人,问把所有的外星人都搜出来花的最小时间.一条路径上的时间跟人数是无关的,只跟路径长度有关. 思路:刚开始人都在起点,当派一定人数去最近的外星人 ...
- Javascript 【JSON对象】
var box = JSON.parse(json); //将字符串解析为JSON var json = JSON.stringify(box); //讲JSON转换为字符串 var b ...