Is it possible to draw unfilled figures on Android? By default circles and rectangles are filled.
Asked
Active
Viewed 4.1k times
1 Answers
175
You need to change the Paint
style to stroke if you just want an outline with no fill:
Paint p = new Paint();
p.setStyle(Paint.Style.STROKE);

K-ballo
- 80,396
- 20
- 159
- 169
-
Using green color when painting. After changing style to stroke I'm getting a black fill. Is it possible to get it to be transparent? – Jan-Terje Sørensen Aug 15 '13 at 11:06
-
2@arcone `p.setColor(0x99000000);` The color-parameter accepts an hex-code in the form 0xaarrggbb (a=alpha, r=red, g=green, b=blue) – MyPasswordIsLasercats Jun 23 '14 at 07:28