Animating SwiftUI Applications by Stephen DeStefano

Animating SwiftUI Applications by Stephen DeStefano

Author:Stephen DeStefano
Language: eng
Format: epub
Publisher: Packt
Published: 2023-05-15T00:00:00+00:00


Creating a stroke animation on the heart image

Okay, we have animated our first image, so we are going to follow the same process again for two more images. The next image will be a heart – for this one, we will animate a stroke around it as we did with the letters, but also we will add the heart image back into the scene.

If you are following along with the book’s project, you can find the heart image in the GitHub repository, where the background has already been removed. However, if you are using your own images, you will need to do this yourself.

After you have prepared your image, now open it with Inkscape so that you can vectorize it. With the image selected in the editor, go to the Path menu at the top and choose Trace Bitmap; this will trace the image and prepare it for vectorization, as before.

With the image selected on the canvas, if you look at the Previews pane at the right, the image has been converted into black and white. That’s because, by default, Inkscape selects the Single Scan option, the option for black-and-white images. And even though this is a color image, because it’s such a simple shape with not many variations of red in it, we don’t need the Multicolor option; so, Single scan will work fine here.

This is also a good opportunity to use the Smooth Corners option as well because this shape has (for the most part) smooth corners, and this selection will preserve them.

This is what it should look like so far:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.