Note that there are some explanatory texts on larger screens.

plurals
  1. POImage getting pixelated when used as part of an animation in iPhone animation
    text
    copied!<p>After countless tries I got my animation animating right (Why oh why is the layer's coordinate system Y flipped from the view's coordinate system, I will never guess) but it seems that it degrades the image quality for some reason:</p> <p><img src="https://imgur.com/PZOR0.png" alt=""></p> <p>(green circled are examples of the original good quality images, the red circled is to emphasize the difference. <a href="https://imgur.com/PZOR0.png" rel="nofollow noreferrer">original image.</a>).</p> <p>Close up:</p> <p><img src="https://imgur.com/kq5L6.png" alt="alt text"></p> <p>(The lower images are as supposed to be, except the left one. The rest are pixelated.)</p> <p>The code I'm using (approximately, you can see the exact one in the image.):</p> <pre><code>CGImageRef *ir = [UIImage imageNamed:@"something"].CGImage; CALayer *cl = [CALayer layer]; cl.contents = ir; CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; anim.duration = 5; anim.autoreverses = NO; anim.removedOnCompletion = NO; anim.fromValue = **something** anim.toValue = **anotherthing** [cl addAnimation:anim forKey: @"fallDown"]; </code></pre> <p>My questions:</p> <ol> <li><p>Why is there such a difference between the images? How do I fix it?</p></li> <li><p>How is my code? I just can't find enough examples / explanations about the animation types and all stuff you can do with it (for example all of the animatable properties). And I am learning the SDK by myself (I have iPhone in Action but it's quite basic) and there is no one I know to review my code :)</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload