Re: Getting pixel color from NSView
Re: Getting pixel color from NSView
- Subject: Re: Getting pixel color from NSView
- From: Volker in Lists <email@hidden>
- Date: Sun, 25 Jan 2009 20:32:51 +0100
Hi,
one possibility, even so I doubt it is the most elegant, is to create
a BitmapRepresentation of the view and get the color from this image.
More elegant would be, if you would be able to use the information
from the "tiling method", for example by storing the random colors in
an array of kind.
Maybe some details on how you create the tiles would be helpful?
Cheers, Volker
Am 25.01.2009 um 20:06 schrieb Ashley Perrien:
Is there a way to get the color of a pixel or area of an NSView
during the drawRect method? I'll be tiling the view with a grid of
random colors but each tile is based on the colors around it. I'd
prefer to call something along the lines of:
NSColor *aColor = [myView colorAtPoint: somePoint];
Rather than creating and filling a potentially quite large array of
colors.
-Ashley
_______________________________________________
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