• 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: How to capture data from NSImageView and display in NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to capture data from NSImageView and display in NSView


  • Subject: Re: How to capture data from NSImageView and display in NSView
  • From: Michael Vannorsdel <email@hidden>
  • Date: Fri, 23 May 2008 16:14:58 -0600

On May 23, 2008, at 3:32 PM, Stephen Herron wrote:

The goal:
A window with two views. The view on the left, NSImageView, displays the NSImage from - (void)openPanelDidEnd:. The right view, NSView, displays the result of a CIFilter using the pixel data displayed in the right-hand view.


The problem:
I cannot convert the NSImage used in the NSImageView to a CIImage because:
1. I do not know how to access the NSImage pixel data


You can make an NSBitmapImageRep and draw the NSImage into that.


2. I do not know how to convert NSImage data to CIImage data. (The developer site has code samples for CGImage to CIImage but nothing for NSImage to CIImage?)


There's a handful of ways and depends what works best for you. One is to get an NSData with TIFFRepresentation and use that data to initWithData: a CIImage. Or make it with the bitmap created from the above.

There's also ways to do these using CoreGraphics if you need those types as well. If so I can give examples using those.
_______________________________________________


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


  • Prev by Date: Errors from NSTreeController (or NSOutlineView?)
  • Next by Date: Re: File's Owner
  • Previous by thread: Re: Errors from NSTreeController (or NSOutlineView?)
  • Next by thread: NSArray for (... in ...)
  • Index(es):
    • Date
    • Thread