An image representation belonging to the receiver, or nil if you want the receiver to choose which image representation to use.
Discussion
This method sets the current drawing context to the area of the offscreen window used to cache the specified image representation's contents. Subsequent drawing commands are composited to this offscreen window. If the offscreen drawing area already has some content, any new drawing commands are composited with that content. This method does not modify the original image data directly.
If imageRepresentation is nil, this method acts like the lockFocus method, setting the focus to the best representation for the NSImage object.
A successful lockFocusOnRepresentation: message must be balanced with a matching unlockFocus message to the same NSImage object. These messages bracket the code that draws the image.
If lockFocusOnRepresentation: is unable to focus on the specified image representation, it raises an NSImageCacheException.
Special Considerations
This method is deprecated as it did not set up imageRepresentation as a drawing destination, it set the image up as a drawing destination, then drew imageRepresentation into it. You can replace this functionality with the following code fragment: