icns

How to create a ICNS icon programmatically?

▼魔方 西西 提交于 2020-01-01 14:22:07
问题 OK this is what I want : Take some NSImage s Add them to an ICNS file Save it This is what I've done so far (purely as a test) : - (CGImageRef)refFromImage:(NSImage*)img { CGImageSourceRef source; source = CGImageSourceCreateWithData((CFDataRef)[img TIFFRepresentation], NULL); CGImageRef maskRef = CGImageSourceCreateImageAtIndex(source, 0, NULL); return maskRef; } - (void)awakeFromNib { NSImage* img1 = [NSImage imageNamed:@"image1"]; NSImage* img2 = [NSImage imageNamed:@"image2"]; NSLog(@"%@"

How to set the application icon in a Qt application on OS X, sufficient for distribution?

风流意气都作罢 提交于 2019-12-12 15:23:26
问题 Following up on this answer to this question, I would like a clear, step-by-step set of instructions on how to set the application icon for a Qt application on OS X sufficient for distribution of the application via an installer and/or through the App Store. The instructions should include how to set the four sizes of the icon, as referenced in the linked answer, above. Please bear in mind that I have no experience in distributing OS X applications, building installers for OS X applications,

Creating an ICNS Programmatically : “Unsupported Image Size”

泄露秘密 提交于 2019-12-08 05:13:49
问题 I'm trying to create an ICNS (including a 1024x1024 image) programmatically. Currently I'm creating an NSImage , then I create CGImageRef objects with the appropriate resolution, finally I'm adding them to an icon by using CGImageDestinationAddImage() . Peter Hosey has helped me create '@2x' images already, but the sizes of the images don't wanna be set. This is the code (still a bit messy, sourcefile represents the path to the image) : NSSize sizes[10]; sizes[0] = NSMakeSize(1024,1024);

Creating an ICNS Programmatically : “Unsupported Image Size”

心已入冬 提交于 2019-12-06 14:34:52
I'm trying to create an ICNS (including a 1024x1024 image) programmatically. Currently I'm creating an NSImage , then I create CGImageRef objects with the appropriate resolution, finally I'm adding them to an icon by using CGImageDestinationAddImage() . Peter Hosey has helped me create '@2x' images already, but the sizes of the images don't wanna be set. This is the code (still a bit messy, sourcefile represents the path to the image) : NSSize sizes[10]; sizes[0] = NSMakeSize(1024,1024); sizes[1] = NSMakeSize(512,512); sizes[2] = NSMakeSize(512,512); sizes[3] = NSMakeSize(256,256); sizes[4] =

How to create a ICNS icon programmatically?

好久不见. 提交于 2019-12-04 12:06:31
OK this is what I want : Take some NSImage s Add them to an ICNS file Save it This is what I've done so far (purely as a test) : - (CGImageRef)refFromImage:(NSImage*)img { CGImageSourceRef source; source = CGImageSourceCreateWithData((CFDataRef)[img TIFFRepresentation], NULL); CGImageRef maskRef = CGImageSourceCreateImageAtIndex(source, 0, NULL); return maskRef; } - (void)awakeFromNib { NSImage* img1 = [NSImage imageNamed:@"image1"]; NSImage* img2 = [NSImage imageNamed:@"image2"]; NSLog(@"%@",img1); CGImageRef i1 = [self refFromImage:img1]; CGImageRef i2 = [self refFromImage:img2]; NSURL

How to change icon of alias created using applescript?

左心房为你撑大大i 提交于 2019-12-01 13:34:09
I have an applescript which creates a shortcut on a desktop to an executable on the file system. The excutable has the standard exec icon . Is it possible to change the icon to point to say an icns file ? I've read you can do it using a third party program as mentioned in Change icon of folder with AppleScript? but is it possible without using an external program to do this ? This is my script set source_file to (POSIX file "path to my exectuable") tell application "Finder" make new alias file at desktop to source_file set name result to "My Shortcut" end tell Note: I can also create the same

How to change icon of alias created using applescript?

本秂侑毒 提交于 2019-12-01 10:50:42
问题 I have an applescript which creates a shortcut on a desktop to an executable on the file system. The excutable has the standard exec icon . Is it possible to change the icon to point to say an icns file ? I've read you can do it using a third party program as mentioned in Change icon of folder with AppleScript? but is it possible without using an external program to do this ? This is my script set source_file to (POSIX file "path to my exectuable") tell application "Finder" make new alias