Re: Performance & new Pen() / new Brush()

Tech-Archive recommends: Fix windows errors by optimizing your registry



We tend to use a singleton and cache pens and brushes that are frequently used there. Havent seen any problems.
There should also be some predefined system pens and brushes you can use.

James

http://www.crainiate.net


Lloyd Dupont wrote:
In my drawing code I recusrively create an average number of pens and brushes of, let's guess: 300?
Would I see performance improvment by just caching those?

(actually I use and create all of them in a using() statment)

.