|
-
October 21st, 2014, 02:12 PM
#1
Does it make sense top new-up pens and brushes in OnPaint() every time it's called?
Folks,
I need to make a fairly simple WinForms custom control. It will have about hundred or so graphics shapes (lines, circles). Little to no animation. At the moment of writing, I don't expect it to be very graphics intensive. At the same time, I don't have experience with drawing custom controls.
I've following this tutorial: Creating a professional looking GDI+ drawn custom control. I've noticed that some brushes in this tutorial are member variables (fields) of the control, and those are initialized once. Other brushes and pens are newed-up every time OnPaint() is called and disposed.
Is it okay to new-up pens and brushes in OnPaint() every time it's called? Does that make sense?
Any suggestion, insight or reference is really appreciated!
Cheers,
- Nick
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|