Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: altering an NSImage by access to pixels
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: altering an NSImage by access to pixels



On Aug 18, 2011, at 4:16 PM, James Walker wrote:

> Let's say I have an NSImage that contains some representation other than an NSBitmapImageRep, and I want to play with the pixel values.


Create your NSBitmapImageRep
Create a NSGraphicsContext from that rep and make it current
Draw your NSImageRep using -draw (or -drawAtPoint: or -drawInRect:) to draw into the current graphics context.

You now have an NSBitmapImageRep with your image contents.
--
David Duncan

_______________________________________________

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

References: 
 >altering an NSImage by access to pixels (From: James Walker <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.