Initializes and returns an image object with the contents of the specified file.
- macOS 10.0+
A full or relative path name specifying the file with the desired image data. Relative paths must be relative to the current working directory.
NSImage object or
nil if the method cannot create an image representation from the contents of the specified file.
init(by, which initializes an
NSImage object lazily, this method immediately opens the specified file and creates one or more image representations from its data.
filename parameter should include the file extension that identifies the type of the image data. This method looks for an
NSImage subclass that handles that data type from among those registered with