tags:

views:

28

answers:

1

Hello,

The following code snippet draws a red rectangle:

RectF rectangle = new RectF(50, 100, 100, 50);
Paint paint = new Paint();
paint.setColor(Color.RED);
canvas.drawRoundRect(rectangle, 0, 0, paint);

However if i change rx and ry both to a positive value, say 5, than nothing is shown. Any ideas?

A: 

Your rectangle definition is incorrect. The parameters of a RectF are left, top, right and bottom, not x, y, width and height. Try with 50, 100, 150, 150 for instance.

Romain Guy
That did the trick! Many thanks.
Friendly ghost