• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why use NSCustomImageRep for drawing in code in NSImage?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Why use NSCustomImageRep for drawing in code in NSImage?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Window Controller 'Presentation' in IB
  • Next by Date: Re: Using AV Foundation to record m3u8 stream to disk
  • Previous by thread: Window Controller 'Presentation' in IB
  • Next by thread: Re: Why use NSCustomImageRep for drawing in code in NSImage?
  • Index(es):
    • Date
    • Thread