Smoother drawing on canvas?

ondesic

Active Member
Licensed User
Longtime User
I have a panel and a canvas. In the panel_touch event, I am trying to make a finger drawing that is smooth.
I have tried a rectangle drawn at my touch coodinates, however, it is very choppy, and doesn't draw a smooth line.
I have tried drawing a line from my last x and y to the new one. It's better, but still choppy. I am only invalidating the area I draw (incase this is slowing things down).
Any suggestions on how to draw smoothly on the panel? Thanks
 

ondesic

Active Member
Licensed User
Longtime User
Thank you for the comments. My code is already identical to both examples. My problem is, if I move too quickly, there are gaps between the lines.
 
Upvote 0

Mikie

Member
Licensed User
Longtime User
Klaus,

If the user made a 4, is there anyway to have the app to interpret it to be the number 4. Am I dreaming?

Mikie
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
@ondesic
What LineStroke do you use ?
As I already mentioned with a LineStroke of 1 you could have trouble ?

I tried it once again in the Emulator and on a device, nothing is missing even when drawing very very quickly, LineStroke = 5.
Do you get missing lines with the code I posted ?
Post your code so we can have a look at it and see what happens.

@Mikie
Could be possible, but would probably need quite some graphics treatment.
I don't have any experience in that subject.

@thedesolatesoul
No need to interpolate between points, the program draws always a line between two points in the Touch event routine.

Best regards.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…