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

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


References: 
 >NSImage resizing (From: "Parimal Das" <email@hidden>)

  • Prev by Date: Re: A Data Object in Cocoa
  • Next by Date: Re: Weird problem: Application terminates unexpectedly after closing NSOpenPanel sheet
  • Previous by thread: NSImage resizing
  • Next by thread: Re: NSImage resizing
  • Index(es):
    • Date
    • Thread