Re: Keeping grayscale image grayscale
Re: Keeping grayscale image grayscale
- Subject: Re: Keeping grayscale image grayscale
- From: Ken Ferry <email@hidden>
- Date: Wed, 19 Oct 2011 01:17:19 -0700
On Tue, Oct 18, 2011 at 6:26 AM, Jonathan Taylor <email@hidden>wrote:
> Belated thanks for the various replies to my question. I'm working through
> the posted code and links now and looking at what I can learn from it. One
> query though:
>
> On 12 Oct 2011, at 16:42, Heinrich Giesen wrote:
> > Another rule of thumb is: if you need -[NSImage TIFFRepresentation] you
> do something wrong.
> > (There are of course counterexamples).
>
> I've heard this said before, and have mostly eliminated it from my code.
> However the cocoadev page on NSBitmapImageRep does specifically say "A
> correct use of TIFFRepresentation is one that sends the resulting data
> outside of the process. For example, write to disk, write to pasteboard,
> write to network". So is there a particular reason why there is a problem
> with my line:
> [[destImage TIFFRepresentation] writeToFile:destFile atomically:NO];
>
No, that's a fine use of TIFFRepresentation.
NSBitmapImageRep also responds to -TIFFRepresentation, which will likely be
more convenient if you've switched to drawing in an NSBitmapImageRep.
-Ken
>
> Thanks
> Jonny_______________________________________________
>
> 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
>
_______________________________________________
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