title: UIImage with rounded corners
body: <p>I have read several posts already. And almost everyone suggest using <code>QuartzCore/QuartzCore.h</code> with <code>layer.cornerRadius</code></p>
  
  <p>I have tried this method and some more methods.</p>
  
  <p>Well, everything works fine when an image doesn't move.</p>
  
  <p>But in my project I always move my images.
  If I add corner radius or a shadow the image movement is no longer smooth. And it looks aweful!</p>
  
  <p>That is the way I resize my image:</p>
  
  <pre><code>CGSize newSize = CGSizeMake(200*height/image.size.height, 280);
  CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
  CGContextRef context = CGBitmapContextCreate(nil, newSize.width, newSize.height, 8, 0, colorSpace, kCGImageAlphaPremultipliedLast);
  CGContextClearRect(context, CGRectMake(0, 0, newSize.width, newSize.height));
  CGContextDrawImage(context, CGRectMake(0, 0, newSize.width, newSize.height), image.CGImage);
  CGImageRef scaledImage = CGBitmapContextCreateImage(context);
  CGColorSpaceRelease(colorSpace);
  CGContextRelease(context);
  UIImage *newImage = [UIImage imageWithCGImage: scaledImage];
  CGImageRelease(scaledImage);
  </code></pre>
  
  <p>I would like to know a good way to resize my image, add shadow, corner radius and still have smooth movement of my image.</p>