Function

UIGraphicsGetImageFromCurrentImageContext

Returns an image based on the contents of the current bitmap-based graphics context.

Declaration

UIImage * UIGraphicsGetImageFromCurrentImageContext(void);

Return Value

A image object containing the contents of the current bitmap graphics context.

Discussion

You should call this function only when a bitmap-based graphics context is the current graphics context. If the current context is nil or was not created by a call to UIGraphicsBeginImageContext, this function returns nil.

This function may be called from any thread of your app.

See Also

Image Creation

UIGraphicsBeginImageContext

Creates a bitmap-based graphics context and makes it the current context.

UIGraphicsEndImageContext

Removes the current bitmap-based graphics context from the top of the stack.

UIImageJPEGRepresentation

Returns the data for the specified image in JPEG format.

UIImagePNGRepresentation

Returns the data for the specified image in PNG format