Home > OS >  Image is pixelated during CGAffineTransform scale animation
Image is pixelated during CGAffineTransform scale animation

Time:09-01

I am trying to mimic the Twitter launch screen, the issue I have is that, whether I use a system icon or a named SVG image, while I animate the scaling of the image to get that "zoom in" effect, the image is getting pixelated, which is reasonable since I scale it. So that brings the question, is there a way to scale up the image in a way that won't damage the quality? so the scaling animation will not look pixelated when the image is scaled up?


Example of the issue:

CodePudding user response:

One workaround would be to draw the Twitter icon using UIBezierPath. You can use the ready-to-use PocketSVG library. It will give you an array of paths which you can combine and then add it to a CAShapeLayer. With that you can then apply transformation to the shape or path as you wish without worry about the quality.

  • Related