公告
财富商城
积分规则
提问
发文
2019-02-02 22:24发布
乱世女痞
Can I draw with anti-aliasing on canvas?
I need my circles and line have smooth edges.
Check this out. It fairly uses smooth edges.. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html
The paint properties needed to get anti-aliasing is :
mPaint = new Paint(); mPaint.setAntiAlias(true);
For drawing use:
mPath = new Path(); mPath.reset(); mPath.moveTo(x, y);//can be used where to trigger the path
onDraw method should contain:
canvas.drawPath(mPath, mPaint);
Declare the mPath and mPaint as global.
Drawing operations want Paint. In this Paint you set Paint.setFlags(Paint.ANTI_ALIAS_FLAG)
Paint
Paint.setFlags(Paint.ANTI_ALIAS_FLAG)
最多设置5个标签!
Check this out. It fairly uses smooth edges.. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html
The paint properties needed to get anti-aliasing is :
For drawing use:
onDraw method should contain:
Declare the mPath and mPaint as global.
Drawing operations want
Paint
. In thisPaint
you setPaint.setFlags(Paint.ANTI_ALIAS_FLAG)