2011-07-30 8 views
4

すべてのiPhone 3.0-4.x用にデプロイする4.x用のアプリケーションを作成しました。私はimageWithCGImage:scale:orientationメソッドが4.0以降でのみ利用可能であることに気付きました。 3.xの代替手段はありますか?参考のために:UIImageのimageWithCGImageに似ています。スケール:orientation:

Creates and returns an image object with the specified scale and orientation factors. 
+ (UIImage *)imageWithCGImage:(CGImageRef)imageRef scale:(CGFloat)scale orientation:(UIImageOrientation)orientation 

私の現在の使用状況:

UIImage *inputImage = [UIImage imageWithCGImage:[[UIImage imageNamed: @"arrow.png"] CGImage] scale:1.2 orientation:UIImageOrientationUp]; 

規模は静的である(つまり、私はそれを変更することはありません)ので、私が代わりにフォトショップを介して画像を拡大縮小かもしれないが、方向は自分のアプリケーションで必要性のまま。

ありがとうございます!

+1

を使用することができ、それをチェックしhttp://paulsolt.com/2010/09/ios-converting-uiimage-to-rgba8-bitmaps-and-back / – ram

答えて

2

スケールは、CGContext関数で回転(変換)できます。そして、あなたは...

CGImageRef CGBitmapContextCreateImage (
    CGContextRef c 
); 

+ (UIImage *)imageWithCGImage:(CGImageRef)cgImage 
関連する問題