Image getting pixelated when used as part of an animation in iPhone animation

Image getting pixelated when used as part of an animation in iPhone animation

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:

(green circled are examples of the original good quality images, the red circled is to emphasize the difference. original image.).

Close up:

alt text

(The lower images are as supposed to be, except the left one. The rest are pixelated.)

The code I'm using (approximately, you can see the exact one in the image.):

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"]; 

My questions:

  1. Why is there such a difference between the images? How do I fix it?

  2. 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 :)

[iPhone SDK] [Newbie] UITextView textViewDidChange will not be called?


conflict between JQuery slider and iui (iphone)
A friend had a stroke of genius: my image files were huge. Anyone know how to slide in a UIDatePicker like keyboard?When I switched to using smaller files (resized) everything looked the same. Managing data for UITableViewsI'm guessing there is any resizing issue here.. How to get a C method to accept UIImage parameter? Thanks RL... how to release uiview added as subview in scrollview?:). Populate a UITableView with data
Dynamically change url or WordPress theme if UserAgent is iPhone

96 out of 100 based on 71 user ratings 626 reviews