开发者

How to access a different formats within an icns file (Apple Icon Image format)

开发者 https://www.devze.com 2023-03-28 14:11 出处:网络
does anyone know how to access different formats of an icns file? For example this file contains multiple sizes of t开发者_Python百科he same icon:

does anyone know how to access different formats of an icns file? For example this file contains multiple sizes of t开发者_Python百科he same icon:

How to access a different formats within an icns file (Apple Icon Image format)

In some cases I just want the large one and in other cases I want the small one. I couldn't find something in Cocoa.


An NSImage is a container for NSImageReps. When you load an icns file, you get an image containing an NSBitmapImageRep for each size in the file. You can iterate over the image’s representations property to access them. (Also, the image will automatically choose the most appropriate rep when drawing.)

0

精彩评论

暂无评论...
验证码 换一张
取 消