CanvasDrawingSessionDrawInk Method (IEnumerableInkStroke, Boolean) |
Namespace: Microsoft.Graphics.Canvas
public void DrawInk( IEnumerable<InkStroke> inkStrokes, bool highContrast )
This overload allows an app to use an arbitrary high-contrast accessibility option, which may be different from the one globally specified in the system environment.
To draw ink from a collection of saved strokes saved to a stream, use the GetStrokes method from its InkManager or stroke container. For example:
await inkManager.LoadAsync(inputStream); using (CanvasDrawingSession ds = canvasRenderTarget.CreateDrawingSession()) { ds.DrawInk(inkManager.GetStrokes()); }
To draw ink from an InkCanvas using custom drying, use BeginDry from the InkSynchronizer object. For example:
InkSynchronizer inkSynchronizer = inkCanvas.InkPresenter.ActivateCustomDrying(); using (CanvasDrawingSession ds = canvasRenderTarget.CreateDrawingSession()) { var strokes = inkSynchronizer.BeginDry(); ds.DrawInk(strokes); inkSynchronizer.EndDry(); }