Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIImage'的替代方案;带CGImage的s图像:比例:方向:_Iphone_Objective C_Ios4_Iphone Sdk 3.0_Uiimage - Fatal编程技术网

Iphone UIImage'的替代方案;带CGImage的s图像:比例:方向:

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:

我为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:(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