开发者

Is there a UIImage imageWithCGImage:scale:orientation: method? Or wrong doc & wrong approach?

Since I need to place images along all 4 sides of t开发者_如何学编程he iPad, I assumed that I could use one of these methods to put the image's orientation 'up' relative to the respective side.

I'm relatively new to the iOS, but I read through the Apple doc. Because the Apple documentation seems to suggests that I could accomplish this with the UIImage class, forward I went. Specifically, their UIImage Class Reference doc states that there is a class method "imageWith..." and an instance method "initWith...". But I can't find either in the header file. I assume that the header file is golden. Am I missing something obvious?

Suggestions for an alternate approach - meaning, what classes and doc should I read? Or code examples?

Thanks

David


The class reference is correct. You should be able to find the method declaration in UIImage.h as well, e.g. in iPhone SDK 4.1 there is:

UIKIT_EXTERN_CLASS @interface UIImage : NSObject {
  @package
    ...
}

...
+ (UIImage *)imageWithCGImage:(CGImageRef)imageRef scale:(CGFloat)scale orientation:(UIImageOrientation)orientation __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);

...
- (id)initWithCGImage:(CGImageRef)imageRef scale:(CGFloat)scale orientation:(UIImageOrientation)orientation __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);

Note that this method is only available since 4.0. If your SDK is configured for 3.2 then you can't use this method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜