setDataRetained:
Sets whether the image retains its source image data.
Declaration
- (void) setDataRetained:(BOOL) flag;Parameters
Discussion
Retention of the source image data is important if the source of the image data could change, be moved, or be deleted. Data retention is also useful if you plan to resize an image frequently; otherwise, resizing occurs on a cached copy of the image, which can lose image quality during successive scaling operations. With data retention enabled, the image is resized from the original source data.
If the responsibility for drawing the image is delegated to another object, there is no reason to retain the image data. Similarly, if the source of the image data is not expected to change or you do not plan to resize the image, you do not need to retain the data. In fact, retaining the data leads to increased memory usage, which could have a negative impact on performance.
If you create your image object using the init(byReferencingFile:) method, the only data retained is the name of the source file.
See Also
Instance Methods
lockFocus()lockFocusFlipped(_:)unlockFocus()init(iconRef:)lockFocusOnRepresentation:bestRepresentationForDevice:compositeToPoint:operation:compositeToPoint:fromRect:operation:compositeToPoint:fromRect:operation:fraction:compositeToPoint:operation:fraction:dissolveToPoint:fraction:dissolveToPoint:fromRect:fraction:setScalesWhenResized:scalesWhenResizedisDataRetained