Jump to content

How does Paint.NET draw so quickly?


Recommended Posts

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?

Link to comment
Share on other sites

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.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

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.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...