Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw unfilled figures on Android?

Is it possible to draw unfilled figures on Android? By default circles and rectangles are filled.

like image 269
Suzan Cioc Avatar asked May 15 '12 15:05

Suzan Cioc


People also ask

What is canvas drawing in Android?

Canvas is a class in Android that performs 2D drawing of different objects onto the screen. The saying “a blank canvas” is very similar to what a Canvas object is on Android. It is basically, an empty space to draw onto. The Canvas class is not a new concept, this class is actually wrapping a SKCanvas under the hood.

How do you draw a half circle on Android?

You can use <clip /> drawable in order to cut-off part of your circle.


1 Answers

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); 
like image 92
K-ballo Avatar answered Sep 21 '22 08:09

K-ballo