NSMakeSize and correct type
NSMakeSize and correct type
- Subject: NSMakeSize and correct type
- From: Kevin Walzer <email@hidden>
- Date: Thu, 12 Mar 2009 08:08:31 -0400
- Organization: WordTech Communications LLC
Hello,
I'm getting these gcc errors:
macicon.m:29: error: incompatible type for argument 1 of ‘NSMakeSize’
macicon.m:29: error: incompatible type for argument 2 of ‘NSMakeSize’
I have tried using both float and CGFloat in the parameters, and I get
the same complaint. Here is my code:
@interface MacIcon: NSObject
-(int) makeIcon: (NSString *) filePath imagewidth: (float *) width
imageheight: (float *)height outputfile:(NSString *)imagePath;
@end
@implementation MacIcon
-(int) makeIcon: (NSString *) filePath imagewidth: (float *) width
imageheight: (float*)height outputfile:(NSString *)imagePath {
NSApplicationLoad();
//set up autorelease pool
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//retrieve the icon
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:filePath];
//get bitmap representation of icon
NSBitmapImageRep *resizeicon = (NSBitmapImageRep *)[icon
bestRepresentationForDevice:nil];
//set the icon size
[resizeicon setSize:NSMakeSize(width, height)];
[resizeicon setPixelsWide:(int*) width];
[resizeicon setPixelsHigh:(int*)height];
//convert icon to gif, write to file
[[resizeicon representationUsingType:NSGIFFileType properties:nil]
writeToFile:imagePath atomically:NO];
//release memory
[icon release];
[resizeicon release];
[pool release];
return 0;
}
Any suggestions?
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden