当前位置:网站首页>Flutter 实现光影变换的立体旋转效果
Flutter 实现光影变换的立体旋转效果
2022-08-02 13:40:00 【岛上码农】
前言
之前我们提到了 CustomPaint er
的 Paint
可以使用渐变(GradientShader
)来填充绘制的图形,本篇我们来介绍使用图片填充,并且配合动画实现“立体”旋转效果,之所以给“立体”加上引号,是因为实际是通过填充图片自身的光影效果旋转后看起来像是立体效果一样。下面是实现的效果图。
ImageShader 简介
ImageShader
的定义如下,我们来看看各个参数的用途。
image
:用于填充的图像,是Image
类,注意这个Image
类定义在dart:ui
库中,并不是我们用于构建图像组件的Widget
下面的Image
类。tmx
:图形在 x 轴的处理方式,即当被填充的宽度与图片宽度不匹配时,在横轴方向如何填充。tmy
:图形在y 轴的处理方式,即当被填充的高度与图片高度不匹配时,在纵轴方向如何填充。matrix4
:对填充图像的三维空间的平移、旋转等变换操作。filterQuality
:当图片尺寸和被填充图形的尺寸不一致时,采样的质量&#
边栏推荐
- GTK:Gdk-CRITICAL **: IA__gdk_draw_pixbuf: assertion ‘GDK_IS_DRAWABLE (drawable)‘ failed
- 【622. 设计循环队列】
- [b01lers2020]Welcome to Earth-1
- Seata分布式事务
- "Second Uncle" is popular, do you know the basic elements of "exploding" short videos from the media?
- How to do short video food from the media?5 steps to teach you to get started quickly
- 【C语言】剖析函数递归(3)
- Mysql视图
- Oracle update error operation single table rollback
- 短视频美食自媒体怎么做?5步教你快速上手
猜你喜欢
随机推荐
This binding to detailed answers
.Net 5.0 Quick Start Redis
Detailed explanation of stored procedures
WPF效果第一百九十三篇之登录实现
How to do short video food from the media?5 steps to teach you to get started quickly
C语言结构体(入门)
存储过程详解
Singleton pattern of seven kinds of writing, you know?
ORACLE expdp/impdp详解
面试官:可以谈谈乐观锁和悲观锁吗
HALCON: 对象(object)从声明(declaration)到结束(finalization)
腾讯安全游戏行业研讨会:生态共建,护航游戏产业健康发展
RESTful style (detailed introduction + case implementation)
els long block deformation conditions, boundary collision judgment
RestTemplate use: set request header, request body
【ONE·Data || 排序入门】
wait() ,notify(),notifyAll()以及wait()与sleep()比较
Seata Distributed Transaction
【C语言】剖析函数递归(3)
Taurus.MVC V3.0.3 microservice open source framework released: Make the evolution of .NET architecture easier in large concurrency.