Iphone UIImage'的替代方案;带CGImage的s图像:比例:方向:
我为4.x构建了一个应用程序,应该部署在所有iPhone 3.0-4.x上。我意识到imageWithCGImage:scale:orientation方法仅在4.0及更高版本中可用。3.x有其他选择吗?供参考:Iphone UIImage'的替代方案;带CGImage的s图像:比例:方向:,iphone,objective-c,ios4,iphone-sdk-3.0,uiimage,Iphone,Objective C,Ios4,Iphone Sdk 3.0,Uiimage,我为4.x构建了一个应用程序,应该部署在所有iPhone 3.0-4.x上。我意识到imageWithCGImage:scale:orientation方法仅在4.0及更高版本中可用。3.x有其他选择吗?供参考: Creates and returns an image object with the specified scale and orientation factors. + (UIImage *)imageWithCGImage:(CGImageRef)imageRef scale:
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];
缩放是静态的(即,我从不更改它),因此我可以通过photoshop缩放图像,但方向在我的应用程序中仍然是必需的
谢谢 您可以使用CGContext函数进行缩放、旋转(平移)。然后你可以用
CGImageRef CGBitmapContextCreateImage (
CGContextRef c
);
及
检查一下
+ (UIImage *)imageWithCGImage:(CGImageRef)cgImage