init(cgImage:size:)
Creates a new image using the contents of the provided image.
Declaration
convenience init(cgImage: CGImage, size: NSSize)Parameters
- cgImage:
The source image.
- size:
The size of the new image. Use Zero, or Nszerosize in Objective-C, to have the new image adopt the pixel dimensions of the source image.
Discussion
Don’t assume anything about the image, other than drawing it is equivalent to drawing the source image.
This is not a designated initializer.