• 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
Re: Any way to draw a PixMapHandle into an NSView??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any way to draw a PixMapHandle into an NSView??


  • Subject: Re: Any way to draw a PixMapHandle into an NSView??
  • From: Esteban <email@hidden>
  • Date: Thu, 6 Jun 2002 00:40:23 -0700

Roger,

I think you might be able to use NSQuickdrawView for this. But converting the PixMapHandle into an NSImage might be more flexible. You can pretty much stick an NSImage in any place where a view will take it. The NSQuickdrawView is not so flexible, unless you use it as subviews of other views (maybe?).

You can take a look at an example that converts a PixMapHandle into an NSImage, that I wrote a while back at http://homepage.mac.com/estebanuribe/CIconViewer.tgz

Look at the CICNIconReader class it should give you an idea about how to convert the PixMapHandle to an NSImage.

-Esteban

On Wednesday, June 5, 2002, at 10:28 PM, Jeff LaMarche wrote:

On Wednesday, June 05, 2002, at 09:46AM, nicolas berloquin <email@hidden> wrote:
the only problem with this approach (in my opinion) is that you'll have
the overhead of NSImages.
If you're using pixmaphandles for offscreen drawing, seeking efficiency,


True, but I would say that this is a disadvantage in relatively few situations - areas where performance is crucial. On the other hand, you create a lot more code for yourself to maintain, and take upon yourself responsibilities that you don't need to.

Personally, I'd go with my way first because it's easy, it works, and there's only one line of code to maintain. I'd then switch to something like you suggest if performance is suffering or if the code is not sufficient for some other reason. Premature optimization is the root of all evil, and the fastest code is not always the best code for a given situation.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Any way to draw a PixMapHandle into an NSView?? (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: [ot/newbie] Changing init code of widgets in Interface Builder
  • Next by Date: Re: [ot/newbie] Changing init code of widgets in Interface Builder
  • Previous by thread: Re: Any way to draw a PixMapHandle into an NSView??
  • Next by thread: Killing child tasks
  • Index(es):
    • Date
    • Thread