PathEffect,使用mPaint.setPathEffect为path路径设置不同的效果
来源:互联网 发布:淘宝欢乐逛如何使用 编辑:程序博客网 时间:2024/06/13 18:37
转载自:http://www.cnblogs.com/tianzhijiexian/p/4297783.html
当我们的画布canvas使用了drawPath的时候,为画笔mPaint设置PathEffect可以作用于path产生不同的效果。
mPaint.setPathEffect(new CornerPathEffect(50));//路径转角变圆滑
mPaint.setPathEffect(new DiscretePathEffect(3.0F, 5.0F));//路径呈现锯齿效果(数值越大越平滑)
mPaint.setPathEffect(new DashPathEffect(newfloat[] {20, 10}, 1));//绘制虚实线,数组参数的长度必须是2的整数倍,第0个是实线长度,第1个虚线长度,第二个参数表示第0个实线的偏移量。动态修改这个偏移量的值,可实现动画效果。
Path path = new Path();
path.addCircle(0, 0, 3, Direction.CCW);
//自定义路径虚线的样式,比如这里是圆形虚线
PathEffect pathEffect= new PathDashPathEffect(path, 12, phase, PathDashPathEffect.Style.ROTATE);
mPaint.setPathEffect(pathEffect);
canvas.drawPath(mPath, mPaint);
阅读全文
0 0
- PathEffect,使用mPaint.setPathEffect为path路径设置不同的效果
- Paint setPathEffect(PathEffect effect)设置绘制路径的效果
- Path类:利用PathEffect为路径绘制不同效果
- 详解Paint的setPathEffect(PathEffect effect)
- 详解Paint的setPathEffect(PathEffect effect)
- Paint---PathEffect(路径效果)
- Android PathEffect 效果使用
- android Path里面的各种PathEffect
- Android里PathEffect的使用
- Android里PathEffect的使用
- Android中PathEffect的使用
- contextRelative是用来设置当前path路径的为“true”为当前根路径
- PathEffect 实现子类的绘制效果
- PathEffect的应用:android 绘制虚线效果
- Android 关于路径Path的那些效果
- java设置不同path、classpath的方法
- PathEffect 路径特效
- Vim 的 tab 设置(2): 使用 autocmd 为不同的文件类型应用不同的 tab 设置
- 老年(已退役)选手复习计划 PART1
- 1002. 写出这个数 (20)
- 手机上拉刷新 angular
- linux curses函数库
- 空悬指针和野指针
- PathEffect,使用mPaint.setPathEffect为path路径设置不同的效果
- zeromq+python安装手册
- 模块句柄(实例句柄)和句柄的区别
- 静态函数和非静态函数的区别(静态方法和非静态方法)
- 大数据平台的发展会降低程序员的价值吗?
- POJ 3199 Uncle Jack(高精度加速乘)
- 递归建立二叉树
- 解决textarea默认鼠标不是从左上角开始的问题
- VideoView 无法播放此视频