I have an inkStroke in the inkcanvas, and I use method GetInkPoints to get the points collection of the inkstroke, if the inkcanvas size is 100 * 100 and I want to map the inkstroke to a page to 200*200, then I need to scale the inkstroke, the scale factor is 2, if I directly use point x and y to multiply scale factor, the shape of inkstroke will distort sometimes(for example when the inkstrole is a circle), so does anyone know how to make transform to a inkstroke and get its points then?
New added: I find that the inkstroke is consists of several Bézier curves, so does anyone know how to scale Bézier curve? Maybe I can scale each Bézier curve in a stroke and generate a new inkstroke and get its points.
If you want to scaled the
InkStroke, we do not need to get the points in theInkCanvas. We can useInkCanvas.InkPresenter.StrokeContainer.GetStrokesto get all ink strokes in the collection.We can use
InkStroke.PointTransformproperty to set an affine transformation matrix to apply to the eachInkStroke. TheMatrix3x2provideCreateScaleto create a scale matrix from the given X and Y components.For example: