Painting/ Drawing thick lines on canvas

109 views
Skip to first unread message

Uma Bhat

unread,
Nov 23, 2015, 8:46:25 PM11/23/15
to MIT App Inventor Forum
In Drawing Canvas, if line-width is set to get a thick line, the canvas.Drawline blocks result in bizzare zig-zag lines, especially when drawing slowly or with lots of curves. Is there a way to get smoother thick lines?
 
Here's a link where it seems you can do it by using DrawCircle blocks:Doodle (.aia file attached). It works fine when both x, y co-ordinates are either increasing or decreasing ( dragging left-up to right- down and back) and when dragging parellel and perpendicular to the screen. But it misbehaves when canvas is dragged on from  in  right-up to left- down and back The original poster hasn't posted a solution. I tried to solve it , but cannot figure out. It would be helpful to everyone, if anyone here posts a solution.

Regards,

Uma



doodle2.aia

Italo

unread,
Nov 23, 2015, 8:54:14 PM11/23/15
to MIT App Inventor Forum
Put the normal DrawLine block prevX,prevY to currentX,currentY
right after that put a DrawCircle block, currentX, currentY Radius = Canvas.LineWidth / 2 and "true" for filled.

That's it.

Italo

unread,
Nov 23, 2015, 9:18:08 PM11/23/15
to MIT App Inventor Forum
This is how you achieve a continuous line, with a rounded start and end points.


Uma Bhat

unread,
Nov 24, 2015, 11:08:29 AM11/24/15
to MIT App Inventor Forum
Thank you very much!
Now the lines look amazing. That was easy, too... 
Wow... 


Regards,
Uma.


Scott Ferguson

unread,
Nov 25, 2015, 8:01:04 AM11/25/15
to MIT App Inventor Forum
When drawing on the Canvas it is a good idea to set Screen Sizing to Responsive.
This will reduce the Canvas pixellation seen on larger screens as well.
---
sf

Uma Bhat

unread,
Nov 28, 2015, 11:31:03 AM11/28/15
to MIT App Inventor Forum
Thank you.

Uma
Reply all
Reply to author
Forward
0 new messages