Can I paint using anti-aliasing on canvas?
I need my circles, and the line has smooth edges.
Paint operations want Paint . In this Paint you set Paint.setFlags(Paint.ANTI_ALIAS_FLAG)
Paint
Paint.setFlags(Paint.ANTI_ALIAS_FLAG)
Check this. It fairly uses smooth edges. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html
Properties of the paint necessary to obtain smoothing:
mPaint = new Paint(); mPaint.setAntiAlias(true);
To use the picture:
mPath = new Path(); mPath.reset(); mPath.moveTo(x, y);//can be used where to trigger the path
The onDraw method must contain:
canvas.drawPath(mPath, mPaint);
Declare mPath and mPaint global.