pencilkit

Background Image and canvas with pencilKit Swiftui

旧时模样 提交于 2021-02-05 09:01:56
问题 I'm learning about PencilKit. I have a canvas, and I want to set a background image that we can draw on it. When I save my canvas, I want my background image to be visible But I have an error : Cannot convert value of type 'Image' to expected argument type 'UIImage?' Image("badmintoncourt") is an image from my assets I can't find out how to solve it, but I maybe not in the right way to add a background image to my canvas struct Home : View { @State var canvas = PKCanvasView() @Environment(\

Background Image and canvas with pencilKit Swiftui

北慕城南 提交于 2021-02-05 09:01:31
问题 I'm learning about PencilKit. I have a canvas, and I want to set a background image that we can draw on it. When I save my canvas, I want my background image to be visible But I have an error : Cannot convert value of type 'Image' to expected argument type 'UIImage?' Image("badmintoncourt") is an image from my assets I can't find out how to solve it, but I maybe not in the right way to add a background image to my canvas struct Home : View { @State var canvas = PKCanvasView() @Environment(\

Editing PKDrawing in PencilKit

橙三吉。 提交于 2020-07-21 05:23:32
问题 When using PencilKit in iOS 13/iPadOS, how do you change the content in PKDrawing? For example, can I go through all the lines and change the color or width of the lines? Or for selected lines (via lasso)? Or add a straight line in our own code? 回答1: PKDrawing is listed as an Opaque data object. See this Wikipedia Link for an explanation of opaque data object. Unfortunately strokes are not exposed to us. Our only 2 options currently can be found in the docs under Modifying the Drawing.