Various paint objects in Activity

56 views Asked by At

I'm dealing with a canvas where I have to draw several elements of different types, thus several different paint objects. What I want to know is which is more efficient, creating different pain objects or setting different configurations to the same one

1

There are 1 answers

0
Marcos Vasconcelos On BEST ANSWER

It's bad for performance to instantiate objects at the onDraw method (where you are using the Paints), i'm not sure about changing values.

But the usual approach would be to instantiate the Paint objects before and just use each one in its onDraw part.