开发者

Android, drawPoint problem

if have some graphics code that looks something like this:

canvas.drawLine (x01,y01,x02,y02,thePaint); 

canvas.drawLine (x11,y11,x12,y12,thePaint);

canvas.drawPoint(200,200, thePaint);

canvas.drawLine (x31,y31,x32,y32,thePaint);

When the drawing is rendered, the first two lines and the point show up. The third line does not show up. Nothing drawn after the drawPo开发者_StackOverflow社区int shows up.

What is wrong?


Strange. Seems like a bug in Android. For a workaround, try using Paths.

        Path path = new Path();
        path.moveTo(10, 10);
        path.lineTo(20, 20);
        path.lineTo(80, 200);

        canvas.drawPath(path, paint);

        canvas.drawPoint(100, 100, paint);

        path = new Path();
        path.moveTo(10, 100);
        path.lineTo(20, 150);

        canvas.drawPath(path, paint);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜