Re: How to write a .icns file
Re: How to write a .icns file
- Subject: Re: How to write a .icns file
- From: Graham Cox <email@hidden>
- Date: Wed, 04 Jun 2014 10:08:43 +1000
On 4 Jun 2014, at 9:00 am, John Brownie <email@hidden> wrote:
> 2. Doing it manually, I need to get a PNG representation of a particular NSImageRep, but there doesn't seem to be a way of ensuring that I really have an NSBitmapImageRep. Casting brings up a warning that I'm making an assumption that there is a bitmap, but I don't see a way around it. It works, but obviously I'm not doing it right. Anyone know where I should be looking?
how about [rep isKindOfClass:[NSBitmapImageRep class]]?
that's how to check prior to casting that a given cast is allowable.
But as long as the rep supports being drawn, you can always create your own NSBitmapImageRep and draw any other kind of rep into it, then extract the data of the one you created as PNG.
--Graham
_______________________________________________
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