• 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
altering an NSImage by access to pixels
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

altering an NSImage by access to pixels


  • Subject: altering an NSImage by access to pixels
  • From: James Walker <email@hidden>
  • Date: Thu, 18 Aug 2011 16:16:35 -0700

Let's say I have an NSImage that contains some representation other than an NSBitmapImageRep, and I want to play with the pixel values. My plan was like this:

Create a NSBitmapImageRep of the same size as my source image.
Make a new NSImage and add my new representation to it.
Lock focus on the new image.
Draw the source image.
Unlock focus on the new image.
Access the pixels of the bitmap representation.

However, the part about locking focus, drawing, and unlocking focus changes my NSImage so that its representation is no longer of class NSBitmapImageRep. Gaah. Must I drop down to the Core Graphics level to do what I want?
--
James W. Walker, Innoventive Software LLC
<http://www.frameforge3d.com/>
_______________________________________________


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: altering an NSImage by access to pixels
      • From: David Duncan <email@hidden>
  • Prev by Date: Autoscrolling when dragging?
  • Next by Date: Re: altering an NSImage by access to pixels
  • Previous by thread: Re: Autoscrolling when dragging?
  • Next by thread: Re: altering an NSImage by access to pixels
  • Index(es):
    • Date
    • Thread