bouvard jean-christophe's Library tagged → View Popular
How to create MS Paint clone with Python and pygame - Stack Overflow
As I see it, there are two ways to handle mouse events to draw a picture.
The first is to detect when the mouse moves and draw a line to where the mouse is, shown here. However, the problem with this is that with a large brush size, many gaps appear between each "line" that is not straight since it is using the line's stroke size to create thick lines.
The other way is to draw circles when the mouse moves as is shown here. The problem with this is that gaps appear between each circle if the mouse moves faster than the computer detects mouse input.
Here's a screenshot with my issues with both: http://imgur.com/32DXN
What is the best way to implement a brush like MS Paint's, with a decently-big brush size with no gaps in the stroke of the line or no gaps between each circle?
-
As I see it, there are two ways to handle mouse events to draw a picture.
The first is to detect when the mouse moves and draw a line to where the mouse is, shown here. However, the problem with this is that with a large brush size, many gaps appear between each "line" that is not straight since it is using the line's stroke size to create thick lines.
The other way is to draw circles when the mouse moves as is shown here. The problem with this is that gaps appear between each circle if the mouse moves faster than the computer detects mouse input.
Here's a screenshot with my issues with both: http://imgur.com/32DXN
What is the best way to implement a brush like MS Paint's, with a decently-big brush size with no gaps in the stroke of the line or no gaps between each circle?
Selected Tags
Related Tags
Sponsored Links
Top Contributors
Groups interested in python
-
development
Items: 88 | Visits: 49
Created by: zou ave
-
Tom's Programming Sites
programming tech sites
Items: 14 | Visits: 96
Created by: Tom McGinnis
-
python
python related resources.
Items: 3 | Visits: 62
Created by: tgkuo1 Kuo
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo
