Sign up ×

I've been working on this for a while. This code:

Log.i(TAG, "stroke style: " + paint.getStyle());
Log.i(TAG, "stroke cap: " + paint.getStrokeCap());
canvas.drawPoint(p.x, p.y, paint);

prints 'STROKE' and 'ROUND' to the logs, but draws a black SQUARE to the map! Anyone know what I need to be doing differently to produce a dot instead of a square!?


EDIT I'm going to give the below suggestion(s) of using drawCircle a shot, but I was just confused I guess because everything I've read indicates you should be able to indicate you want a circle that way. One example being this google book entry

share|improve this question
I think cap options are for Paths and not for Shapes. –  S.D. Feb 25 '13 at 18:46

3 Answers 3

up vote 0 down vote accepted

you can try drawCircle() with p.x and p.y as center (first and second argument) and use 1 or 2 as radius depend on how big you want the dot to be and use the paint with stroke style FILL..

share|improve this answer

Try to use drawCircle instead

circlePaint.setColor(0xFFFF0000); //opaque red
float radius = 10f; //10 pixels

canvas.drawCircle(p.x, p,y, radius, circlePaint);
share|improve this answer

It draws correctly if you draw to a canvas backed by a bitmap. It doesn't seem to draw correctly if you draw directly to the screen (i.e. a canvas passed to a View's onDraw() method). Another way of getting around the problem is, therefore, to first render to a bitmap and then draw that to the screen.

share|improve this answer

Your Answer


