• 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 read pixel values of monochrome images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read pixel values of monochrome images


  • Subject: Re: How to read pixel values of monochrome images
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Sun, 24 Aug 2008 11:09:38 +0200


Le 24 août 08 à 05:55, John C. Randolph a écrit :


On Aug 23, 2008, at 2:51 PM, Shawn Erickson wrote:

On Fri, Aug 22, 2008 at 2:54 AM, Eduardo Areitio <email@hidden> wrote:
I'm trying to read individual pixel values in a monochrome image using
NSReadPixel, but I haven't been able to.


I would much appreciate anyone's help

It is usually best to post some code or better explain what you tried and what is going wrong otherwise we have to guess at the difficulty you are having.

Anyway...

http://developer.apple.com/samplecode/Color_Sampler/listing5.html

You'll notice from the comments in that sample, that NSReadPixel() gets a value from the graphics context that has the current drawing focus. If you're trying to read a value from an image, you've got to have somewhere to draw it first.

You can get the image context directly using -[NSImage lockFocus]. No need to draw it before.

_______________________________________________

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: 
 >How to read pixel values of monochrome images (From: Eduardo Areitio <email@hidden>)
 >Re: How to read pixel values of monochrome images (From: "Shawn Erickson" <email@hidden>)
 >Re: How to read pixel values of monochrome images (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: textfield not updating with bindings - Whats wrong?
  • Next by Date: Re: specify a NSPredicate for jpeg file names?
  • Previous by thread: Re: How to read pixel values of monochrome images
  • Next by thread: Basic Window Management
  • Index(es):
    • Date
    • Thread