How to paint using a ball shape and get painted coordinates in qml?
-
Hi all,
I want to create a small rounded shape(ball shape) which should be movable. After that I will move it on the screen to be able to paint the areas which it passed. At the end of the process, I need to get the coordinates of painted areas.
How can I achieve this? Is there an example which is helpful for my problem? I am new on Qt so I prefer examples to adviced methods.
-
Hi all,
I want to create a small rounded shape(ball shape) which should be movable. After that I will move it on the screen to be able to paint the areas which it passed. At the end of the process, I need to get the coordinates of painted areas.
How can I achieve this? Is there an example which is helpful for my problem? I am new on Qt so I prefer examples to adviced methods.
-
-
@LeLev Thanks for ur reply. This problem can solve my problem's 1st step but I have still a few questions:
- When I moved clicked mouse quickly, canvas cant draw quickly and appears some gaps between lines. Is there a way to fix this issue?
- fillRect method is good which is explained here. But I couldnt find a method for circle. Is there a method to do this with circle. Maybe normal "lineTo" method is already circle, But I cant put dots using "lineTo".
- The most important one: How can I get the coordinates of painted at the end of process?
-
Actually, I fixed my 1st and 2nd problem too, using lineCap by making it "round". My last problem is getting coordinates of painted part.
-
Actually, I fixed my 1st and 2nd problem too, using lineCap by making it "round". My last problem is getting coordinates of painted part.
-
@LeLev But doesnt it give only the middle pixels of a thick line. Does it also give all the pixels inside a thick line or only the middle pixel of line?