Skip to content

Instantly share code, notes, and snippets.

@Uncommon
Created May 27, 2011 02:59
Show Gist options
  • Save Uncommon/994562 to your computer and use it in GitHub Desktop.
Save Uncommon/994562 to your computer and use it in GitHub Desktop.
Write tiffs for all standard NSCursor images
NSArray *cursorNames = [NSArray arrayWithObjects:
@"arrowCursor",
@"IBeamCursor",
@"pointingHandCursor",
@"closedHandCursor",
@"openHandCursor",
@"resizeLeftCursor",
@"resizeRightCursor",
@"resizeLeftRightCursor",
@"resizeUpCursor",
@"resizeDownCursor",
@"resizeUpDownCursor",
@"crosshairCursor",
@"disappearingItemCursor",
@"operationNotAllowedCursor",
@"dragLinkCursor",
@"dragCopyCursor",
@"contextualMenuCursor",
nil];
for (NSString *name in cursorNames) {
NSCursor *cursor = [NSCursor performSelector:
NSSelectorFromString(name)];
NSData *data = [[cursor image] TIFFRepresentation];
[data writeToFile:[NSString stringWithFormat:@"%@.tif",name] atomically:NO];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment