Re: NSImage resizing
Re: NSImage resizing
- Subject: Re: NSImage resizing
- From: Mike Abdullah <email@hidden>
- Date: Fri, 9 Jan 2009 15:34:10 +0000
Try having a play with -[NSImage setScalesWhenResized:]
On 9 Jan 2009, at 13:50, Parimal Das wrote:
hi
in my application i need to resize a .jpg image through a command line
my code is
NSImage *icon = [[NSWorkspace sharedWorkspace]
iconForFile:filePath]; // get
icon from the file at filePath destination
NSSize imageSize;
imageSize.width = 384.0; // in points (384 pts = 512 px )
imageSize.height = 384.0;
[icon setSize:imageSize]; // set image size
NSData * tiffData = [icon TIFFRepresentation];
bitmapImageRep = [NSBitmapImageRep imageRepWithData:tiffData];
[[bitmapImageRep representationUsingType:NSJPEGFileType
properties:dict]
writeToFile:destPath atomically:YES]; // write it to a file path
stored in
destPath
this code is not altering the size at all
i cant create a NSView as its a command line app
any suggestions ??? how to resize it??
Advance Thanx
-Parimal
--
--
Warm Regards,
Parimal Das
_______________________________________________
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
_______________________________________________
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