On Dec 14, 2014, at 8:53 PM, Jerry Krinock <je...@ieee.org> wrote:

> I’m modernizing the old images on some buttons in an OS X app, replacing 
> their .png resources with simple line art, drawn in code.  In so doing I 
> stumbled across Daniel Jalkut’s old LittleYellowGuy demo [1], in which the 
> drawing code is in the delegate of a NSCustomImageRep, which is added to an 
> empty image.  I’ve always done this instead by sending -lockFocus to an empty 
> image and drawing directly into it.  For my purposes, is there any 
> performance or other advantage to using the NSCustomImageRep intermediary?

The article makes it fairly clear that it's about resolution independence.

Apple's recommendation is to use +[NSImage 
imageWithSize:flipped:drawingHandler:].  That creates and manages the 
NSCustomImageRep under the hood.
https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW32

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to