Why use NSCustomImageRep for drawing in code in NSImage?
Why use NSCustomImageRep for drawing in code in NSImage?
- Subject: Why use NSCustomImageRep for drawing in code in NSImage?
- From: Jerry Krinock <email@hidden>
- Date: Sun, 14 Dec 2014 18:53:00 -0800
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?
Thank you,
Jerry
1. http://www.red-sweater.com/blog/223/resolution-independent-fever
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden