icns tool
用了下,蛮好用,导入png,转成icns
转换成png的方法
- (void)saveImage:(NSImage *)image atPath:(NSString *)path {
NSBitmapImageRep *newRep = [NSBitmapImageRep imageRepWithData:image.TIFFRepresentation];
NSDictionary * properties = nil;
NSBitmapImageFileType type = NSPNGFileType;
// 其他格式,改这个type
NSData *pngData = [newRep representationUsingType:type properties:properties];
[pngData writeToFile:path atomically:YES];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if ([[NSFileManager defaultManager] fileExistsAtPath:path]) {
[[NSWorkspace sharedWorkspace] selectFile:path inFileViewerRootedAtPath:@""];
}
});
}
然后用工具转