OurManFlint Posted March 1, 2013 Share Posted March 1, 2013 I am creating my own drawing app using C# .Net/Winforms (for quite a different implementation than Paint.NET) and I am wondering how Paint.NET makes such fast drawing calls. Does it not go through the standard graphics.draw methods? On mine if I draw very quickly, without drawing a line to each of the captured points on MouseMove, there is a lot of space in-between the drawn circles. However, if I do connect them by drawing lines, you can clearly see that there are lines that are connected end-to-end. In Paint.NET, this doesn't happen. It appears that it's drawing bitmap-based ellipses (circles) very quickly so that spaces in-between and lines drawn point-to-point are not an issue. Is that how it works? Quote Link to comment Share on other sites More sharing options...
pyrochild Posted March 2, 2013 Share Posted March 2, 2013 Paint.NET does use GDI for some drawing operations, but is moving away from that. The performance issues you are seeing are because you're drawing on the UI thread. Operations on the UI thread interrupt the message loop and stop your application receiving mouse messages until the operation is finished, making the drawing not smooth. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
OurManFlint Posted March 2, 2013 Author Share Posted March 2, 2013 That is very good info. Thank you! How do I keep it off the UI thread? Would just starting another thread ensure that it's not on that thread? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 2, 2013 Share Posted March 2, 2013 Sorry, but what you're asking could be a very long conversation, and this isn't a programming forum. You'll need to find somewhere more appropriate to ask, such as Stack Overflow. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
OurManFlint Posted March 3, 2013 Author Share Posted March 3, 2013 Sorry, but what you're asking could be a very long conversation, and this isn't a programming forum. You'll need to find somewhere more appropriate to ask, such as Stack Overflow. Yeah, that's a good point. Thanks a lot for the info, though, pyrochild. And hanks for Paint.NET Rick. Keep up the great work! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.