• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSMakeSize and correct type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSMakeSize and correct type
      • From: Ron Fleckner <email@hidden>
    • Re: NSMakeSize and correct type
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Detemine Document Types ...
  • Next by Date: Re: NSMakeSize and correct type
  • Previous by thread: Re: NSTextFieldCell text color issue in NSTableView with source list highlighting
  • Next by thread: Re: NSMakeSize and correct type
  • Index(es):
    • Date
    • Thread