Contents

imageWithCGImage:scale:orientation:

Creates and returns an image object with the specified scale and orientation factors.

Declaration

+ (UIImage *) imageWithCGImage:(CGImageRef) cgImage scale:(CGFloat) scale orientation:(UIImageOrientation) orientation;

Parameters

  • cgImage:

    The Quartz image object.

  • scale:

    The scale factor to use when interpreting the image data. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the Size property.

  • orientation:

    The orientation of the image data. You can use this parameter to specify any rotation factors applied to the image.

Return Value

A new image object for the specified Quartz image, or nil if the method could not initialize the image from the specified image reference.

Discussion

This method does not cache the image object. You can use the methods of the Core Graphics framework to create a Quartz image reference.

See Also

Creating and initializing image objects