Faster way to draw strings?
Faster way to draw strings?
- Subject: Faster way to draw strings?
- From: "Stephan R. Cleaves" <email@hidden>
- Date: Wed, 23 Jan 2002 08:03:35 -0500
Hi,
I've been having difficulties with redraw speed in my application
and have narrowed the problem down to NSGraphics drawAttributedString
method. The problem is most noticeable during resizing of the window
which contains my custom view. What I have done is turn off the drawing
of the strings during resize and i can achieve acceptable redraw speeds,
then when the live resize ends I turn back on the strings. This looks a
bit odd, but currently its the only solution I have. I have over 100
unique strings being drawn in the view, and I do make sure only to draw
the requested region, but often that is the entire view area during live
resize. Is there a faster way to draw strings? Other than using the font
attribute, the over head off the NSAttributedStrings is completely
unnecessary for my application. I Actually use
NSMutableAttributedStrings and pre-cache these, though doing so is not
noticeably faster than just using a single NSMutableAttributedString in
drawRect and changing its string reference string value.
Thanks in advance,
stephan