Closed X901 closed 3 years ago
Yes, All points are stored in the "data" property of Canvas
发自我的iPhone
在 2021年10月22日,07:40,Basil Baragabah @.***> 写道:
Hi , when using PencilKit you can get strokes points , and you can redraw the points is there something like that I can do with the library ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
Yes, All points are stored in the "data" property of Canvas 发自我的iPhone …
I did check .data
but I cannot access points
to give you Idea what I want to do is I need to reach points so I can match between what it was drew and what user drawing
@X901 There's a property called elements
on the class CanvasData
, whitch is the type of data
property on Canvas
. All elements are follow the CanvasElement
protocol. Includes lines(LineStrip
) you draw on the canvas.
A LineStrip
is constructed by several MLLine
s, a MLLine
is a strait line contains two points for begin and end, and other properties such as color, size etc.
@X901 There are two builtin tools called DataExporter
and DataImporter
. You can export all points and other elements data into a JSON file with DataExporter
and then import them to another canvas on even other devices later by DataImporter
.
Thank you ,but it looks like I will need sometimes to understand the data.
Hi , when using PencilKit you can get strokes points , and you can redraw the points is there something like that I can do with the library ?