Initializer

init(cgImage:)

Creates an image object from an existing Core Graphics image.

Declaration

convenience init(cgImage imageRef: CGImage)

Parameters

imageRef

A Core Graphics image reference containing the image data.

Return Value

A new image object or nil if the specified image data was invalid.

See Also

Creating an Image Object

init(named: String)

Creates an image object whose contents are taken from the specified name.

init(uiImage: UIImage)

Creates an image object from an existing UIKit image.

init?(url: URL)

Creates an image object from the image at the specified URL.

init(imageData: Data)

Creates an image object using the specified data.

init?(url: URL, width: Double, height: Double)

Creates an image object from the data at the specified URL and sizes it to the desired width and height.