Permalink
Browse files

Also write out icon built by setting images, not bitmaps, per image s…

…ize. This is a usable work-around for now...
  • Loading branch information...
1 parent 1d851fb commit 136319ddf7a0f9859e15a3e3d2e4f1e34a063845 @danwood danwood committed May 8, 2012
Showing with 12 additions and 3 deletions.
  1. +12 −3 ICOFamilyAppDelegate.m
View
@@ -36,15 +36,24 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSBitmapImageRep *bitmap16 = [[test16 representations] lastObject];
NSBitmapImageRep *bitmap32 = [[test32 representations] lastObject];
- [[bitmap16 TIFFRepresentation] writeToFile:[@"~/Desktop/ICOFamilyTestIcon.16.tiff" stringByExpandingTildeInPath] atomically:NO];
- [[bitmap32 TIFFRepresentation] writeToFile:[@"~/Desktop/ICOFamilyTestIcon.32.tiff" stringByExpandingTildeInPath] atomically:NO];
+// [[bitmap16 TIFFRepresentation] writeToFile:[@"~/Desktop/ICOFamilyTestIcon.16.tiff" stringByExpandingTildeInPath] atomically:NO];
+// [[bitmap32 TIFFRepresentation] writeToFile:[@"~/Desktop/ICOFamilyTestIcon.32.tiff" stringByExpandingTildeInPath] atomically:NO];
ICOFamily *fam = [ICOFamily family]; // Returns an autoreleased instance
+
+ [fam setImage:test16 forElement:kICOFamily16Element];
+ [fam setImage:test32 forElement:kICOFamily32Element];
+
+ [fam.data writeToFile:[@"~/Desktop/ICOFamilyTestIconFromImages.ico" stringByExpandingTildeInPath] atomically:NO];
+
+ // Now try again with the bitmap technique, which chokes on 32-bit images apparently
+
+ fam = [ICOFamily family]; // Returns an autoreleased instance
[fam setBitmapImageRep:bitmap16 forElement:kICOFamily16Element];
[fam setBitmapImageRep:bitmap32 forElement:kICOFamily32Element];
- [fam.data writeToFile:[@"~/Desktop/ICOFamilyTestIcon.ico" stringByExpandingTildeInPath] atomically:NO];
+ [fam.data writeToFile:[@"~/Desktop/ICOFamilyTestIconFromBitmaps.ico" stringByExpandingTildeInPath] atomically:NO];
}
@end

0 comments on commit 136319d

Please sign in to comment.