开发者

Whiteboard on android?

I am trying to make a whiteboard in android. i am using the example suggested in here - Whiteboard Making

but this gives me everything in a dotted line. I want it to appear like a normal writing on a board. How can开发者_开发知识库 that be done.


In the canvas drawing routine, use lineTo instead of drawCircle.


Increase the radius of circle to higher values

public DrawView(Context context) {
    super(context);
    setFocusable(true);
    setFocusableInTouchMode(true);
    this.setOnTouchListener(this);
    paint.setColor(Color.BLACK);
}

@Override
public void onDraw(Canvas canvas) {
    for (Point point : points) {
        canvas.drawCircle(point.x, point.y, 50, paint); //Here radius is 50 
    }
}

public boolean onTouch(View view, MotionEvent event) {
    Point point = new Point();
    point.x = event.getX();
    point.y = event.getY();
    points.add(point);
    invalidate();
    return true;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜