NSImage resizing
NSImage resizing
- Subject: NSImage resizing
- From: "Parimal Das" <email@hidden>
- Date: Fri, 9 Jan 2009 19:20:03 +0530
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