|
-
September 9th, 2012, 05:11 AM
#2
Re: Smoother drawing pen
It is difficult to tell from the information you provided, but it sounds like your main UI thread is too busy updating the bitmap to capture mouse movement points (it can only do one thing at a time). If the problem is as you say - that the line-draw takes time, I would create a multi-thread environment:
1) Main thread captures mouse movement, stores point values in a queue
2) off-thread watcher method checks queue every X milliseconds
3) if watcher has points to process, it does the math, creates the updated bitmap, and send it to the main thread for updating
4) Main UI thread then only has to be "paused" every X milliseconds as it is directly updating the bitmap, freeing it to capture more mouse movement points
If you want to post your project, I can help you with that.
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
|