翻书的效果: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,即可 ...
随机推荐
- Update与Mysql、Sqlsever中的随机数
批量修改数据库中的字段为随机数时 Mysql中的写法: )--取1-50的随机数 Sqlsever中的写法: update t set col=ABS(CHECKSUM(NEWID()))%50+1 ...
- locate命令的安装
linux中locate命令可以快速定位我们需要查找的文件,但是在yum中,locate的安装包名为mlocate(yum list | grep locate可以查看),安装方法: yum -y i ...
- 比较常见的const与指针的组合情况
1.对于普通的const与基本类型组合,都是表示的是这是一个常量, const int a; int const a; 表示的意思是一样的,a是一个常量,不可改变 2.对于const与指针组合在一起, ...
- 1021 Fibonacci Again (hdoj)
Problem Description There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) ...
- UVA 1839 Alignment
还是最长上升子序列... 本题是求队列中任一士兵都能从左边或者右边看到队伍外: 即某一士兵左边为上升子序列,右边为下降子序列.求两个序列和,再用总数减去: #include <iostream& ...
- Google机器学习笔记 4-5-6 分类器
转载请注明作者:梦里风林 Google Machine Learning Recipes 4 官方中文博客 - 视频地址 Github工程地址 https://github.com/ahangchen ...
- Oracle10g安装中遇到的错误及解决办法
linux解决xhost: unable to open display实用技巧:在Linux下设置xhost方法步骤 第一步:用root登陆linux,启动vnc服务:第二步:根据vnc起来的端口, ...
- webshell 匿名用户(入侵者)
“web”的含义是显然需要服务器开放web服务,“shell”的含义是取得对服务器某种程度上操作权限.webshell常常被称为匿名用户(入侵者)通过网站端口对网站服务器的某种程度上操作的权限.由于w ...
- openstack 使用cloud init 和 console-log, nbd或者libguestfs 获取VM中的硬件信息。
以获取PCI的信息为例. 基本代码: pci.py import base64 import guestfs from functools import partial import os impor ...
- hdu 1715 大菲波数_java
用java的大数解决 import java.math.BigInteger; import java.util.Scanner; public class Main { public static ...