Omid Gharib
Omid Gharib

Reputation: 321

what is alternative function for canvas.drawColor in codenameone

I want to use android canvas.drawColor() function in codenameone. what is alternative function for this usage in codenameone or how can i implement a function like this?

Thanks in advance.

Upvotes: 0

Views: 99

Answers (1)

Damian Petla
Damian Petla

Reputation: 9103

If you take a look at Javadoc, Graphics class has 2 methods that will do the job.

First call setColor(int RGB) and then fillRect(0, 0, getWidth(), getHeight()).

This is equivalent to canvas.drawColor(), which in fact is just a shortcut for filling canvas with specified color.

Upvotes: 2

Related Questions