2014年4月9日水曜日

[iOS]1つの画像からretina対応、非対応の画像を作る

NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"image_file" ofType:@"png"];
UIImage *image = [[UIImage alloc] initWithContentsOfFile:imageFilePath];
//resizeImageがRetina対応の画像となる
UIImage *resizeImage = [UIImage imageWithCGImage:image.CGImage scale:2.0 orientation:UIImageOrientationUp];

0 件のコメント:

コメントを投稿