in a finger paint app with using canvas, when i call invalidate()
,the drawing quality is good but speed of drawing comes slow
and when i call invalidate(mRect)
instead, i have something like hand vibration.
private boolean touch_move(int x, int y)
{
float dx = Math.abs(x - mX);
float dy = Math.abs(y - mY);
int rr = 10;
Rect mRect = new Rect();
if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE)
{
mPath.quadTo(mX, mY, (x +mX) / 2, (y + mY) / 2);
TabiCal.myPoints.add(new MyPoint(x, y, mX, mY, TabiCal.color_flag,
TabiCal.thick_flag, 2));
mRect.set(x - rr, y - rr, x + rr, y + rr);
invalidate(mRect);
mX = x;
mY = y;
}
return true;
}
i used antiAlias(true)
, but didn't help me. what is a the solution?