当前位置: 首页 > news >正文

接做网站需要问什么条件wordpress加入mip

接做网站需要问什么条件,wordpress加入mip,网站设计报价单,昆明淘宝网站建设flutter开发实战-CustomClipper裁剪长图帧动画效果 在开发过程中#xff0c;经常遇到帧动画的每一帧图显示在超长图上#xff0c;需要处理这种帧动画效果。我这里使用的是CustomClipper 一、CustomClipper CustomClipper继承于Listenable abstract class CustomClipper e…flutter开发实战-CustomClipper裁剪长图帧动画效果 在开发过程中经常遇到帧动画的每一帧图显示在超长图上需要处理这种帧动画效果。我这里使用的是CustomClipper 一、CustomClipper CustomClipper继承于Listenable abstract class CustomClipper extends Listenable 我们实现CustomClipper子类来实现裁剪功能 class PicCustomClipper extends CustomClipperRect {PicCustomClipper(this.rect);Rect rect;// Rect getClip(Size size) Rect.fromLTWH(0.0, 15.0, 40.0, 30.0);overrideRect getClip(Size size) rect;overridebool shouldReclip(CustomClipperRect oldClipper) true; }getClip()是用于获取剪裁区域的接口由于图片大小是60×60我们返回剪裁区域为Rect.fromLTWH(10.0, 15.0, 40.0, 30.0)即图片中部40×30像素的范围。 shouldReclip() 接口决定是否重新剪裁。 如果在应用中剪裁区域始终不会发生变化时应该返回false这样就不会触发重新剪裁避免不必要的性能开销。 如果剪裁区域会发生变化比如在对剪裁区域执行一个动画那么变化后应该返回true来重新执行剪裁。 二、实现播放帧动画 CustomClipper裁剪长图后每隔一段时间展示长图的不同区域实现帧动画的连贯效果。 class PicFrameAnim extends StatefulWidget {const PicFrameAnim({required this.size, required this.imageSize, Key? key}): super(key: key);final Size size;final Size imageSize;override_PicFrameAnimState createState() _PicFrameAnimState(); }class _PicFrameAnimState extends StatePicFrameAnimwith TickerProviderStateMixin {late Duration _duration;late int _imageIndex;late int _currentIndex;// 定义一个裁剪late PicCustomClipper _clipper PicCustomClipper(Rect.fromLTWH(0.0, 0.0, widget.size.width, widget.size.height));overridevoid initState() {// TODO: implement initStatesuper.initState();_duration Duration(milliseconds: 200);_imageIndex 1;_currentIndex 0;if (widget.size.height 0) {_imageIndex (widget.imageSize.height / widget.size.height).floor();}if (_imageIndex 2) {updateImage();}}void updateImage() {if (_currentIndex _imageIndex) {_currentIndex 0;}_clipper PicCustomClipper(Rect.fromLTWH(0.0,_currentIndex * (widget.size.height),widget.size.width,widget.size.height));_currentIndex;if (mounted) {setState(() {});}Future.delayed(_duration, () {if (mounted) {updateImage();}});}overridevoid dispose() {// TODO: implement disposesuper.dispose();}Matrix4 buildMatrix4() {double dx 0;double dy 0;///Y轴方向平移dy -_currentIndex * (widget.size.height) (widget.size.height);///在XOY平面的平移return Matrix4.translationValues(dx, dy, 0);}overrideWidget build(BuildContext context) {return Container(width: widget.imageSize.width,height: widget.imageSize.height,child: Transform(///构建Matrix4transform: buildMatrix4(),///中心对齐alignment: Alignment.center,child: ClipRect(clipper: _clipper,child: buildBGArrow(context),),),);}Widget buildBGPicImage(BuildContext context) {return Image.network(https://avatars2.githubusercontent.com/u/20411648?s460v4,width: 100.0,height: 300.0, );} }三、小结 flutter开发实战-CustomClipper裁剪长图帧动画效果。 https://blog.csdn.net/gloryFlow/article/details/132253251 学习记录每天不停进步。
http://www.hkea.cn/news/14454966/

相关文章:

  • 成都装修网站制作多少钱wordpress登陆后台很慢
  • 企业网站货物查询怎么做建筑公司是干什么的
  • 制作网站系统网站建设推广书籍
  • 网站根目录文件夹有谁知道知乎网站是谁做的
  • 义乌哪里做网站好软件工程师考试报名
  • 做网做网站建设推书网
  • 四川网站建设方案个人做医疗类网站违法
  • 网站开发环境lmnp河北网站推广优化
  • 深圳市深圳市住房和建设局网站杭州市建设局网站
  • 郑州网站优化推广培训网站建设费计入什么费用
  • 深圳哪家网站设计比较好在线呼叫网页版
  • 网站建设公司类型360搜索引擎的特点
  • 房屋租赁网站开发背景微信辅助做任务网站
  • 朔州市网站建设做摄影网站的目的是什么
  • 广州 网站设计极致cms模板
  • 衡水做wap网站市场监督管理局局长
  • 百度添加网站分析一个网站
  • 创建网站向导和模板个体工商户注册查询
  • 县总工会网站建设情况网站建设会议纪要
  • 做土司的网站合肥网络科技有限公司做网站
  • jquery 网站模板何炅做的代言网站
  • 快速搭建网站后天台部门做网站优点
  • 深圳网站建设民治大道有什么做详情页的参考网站
  • 网络推广优化网站简单的网站开发工具
  • 外贸公司网站有哪些视频拍摄制作报价明细
  • 包装材料东莞网站建设政协网站法治建设
  • 高端网站建设的价格制作宣传图片的软件
  • 公司网站页面购物网站建设需求
  • 丰都县网站谷歌手机网页版入口
  • 网站建设完成之后要索取哪些网站建设新闻+常识