• 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
NSImage resizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSImage resizing
      • From: Steve Christensen <email@hidden>
    • Re: NSImage resizing
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: NSOperation and NSOperationQueue cancellation and ordering questions
  • Next by Date: A Question on estimating +arrayWithCapacity
  • Previous by thread: NSOperation and NSOperationQueue cancellation and ordering questions
  • Next by thread: Re: NSImage resizing
  • Index(es):
    • Date
    • Thread