docs:programming:cocoa_and_objective-c:nsimage

NSImage

Cocoa documentation says that initByReferencingFile is a “lazy” way of doing things, so I assume it should be avoided.

	// initWithContentsOfFile gives us full resolution for some reason, but
	// initByReferencingFile gives us a low resolution representation; we must
	// also have setDataRetained to get and keep the full resolution and prevent
	// blocky pixelation problems
	NSImage *image = [[NSImage alloc] initWithContentsOfFile:file];
	[image setDataRetained:YES];
  • docs/programming/cocoa_and_objective-c/nsimage.txt
  • Last modified: 2008/08/03 00:25
  • by 127.0.0.1