|
-
Apr 15th, 2010, 08:34 AM
#5
Re: GDI functions are slowing down Winsock
How much of the window are you invalidating? By creating a bounding rect as small as possible that encompasses just the area that needs to be redrawn will speed things up.
Faster than invalidaterect?
The issue isn't the API, it is either you are "refreshing" more picturebox than needed, or "refreshing" too often. The question you may need to ask yourself is, "does the graph have to be updated real time?" If the answer is no, then update the graph on a timer. Use a "dirty" flag to indicate the data changed, so the timer event doesn't update the graph if there isn't anything to update (again wasting cpu cycles).
The above is just one idea. Sounds like your graph may be quite large? Please respond to opus' question also.
Edited: also look at your drawing routine; optimize it to death. Example: if the graph scrolls, don't erase & redraw all the points over and over again, slide what doesn't change by using BitBlt.
Last edited by LaVolpe; Apr 15th, 2010 at 08:51 AM.
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
|