Hi,all:
I want to read the RGB value of an image with a NSColor instance,the code as folow:
NSImage * image = [[NSImage alloc] initWithContentsOfFile:
[imagePaths objectAtIndex:i]];
NSColor * color=[NSColor colorWithPatternImage:image];
I go through the help document, there is a instance method to get this value, it is:
- (void)getRedCGFloat *)red greenCGFloat *)green blueCGFloat *)blue alphaCGFloat *)alpha
But it's so regret that it can't work.can you help me and let me know how to use this function!
Thank you very much!
I want to read the RGB value of an image with a NSColor instance,the code as folow:
NSImage * image = [[NSImage alloc] initWithContentsOfFile:
[imagePaths objectAtIndex:i]];
NSColor * color=[NSColor colorWithPatternImage:image];
I go through the help document, there is a instance method to get this value, it is:
- (void)getRedCGFloat *)red greenCGFloat *)green blueCGFloat *)blue alphaCGFloat *)alpha
But it's so regret that it can't work.can you help me and let me know how to use this function!
Thank you very much!