• 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: resize image with cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resize image with cocoa


  • Subject: Re: resize image with cocoa
  • From: Francesca P <email@hidden>
  • Date: Mon, 5 Dec 2005 17:43:17 +0100

OK,
now I'm trying this code but the image is not scaled!!!
And I don't know why!!!

NSImage *immagineDaFile;
[immagineDaFile lockFocus];
[immagineDaFile setScalesWhenResized: YES];
[immagineDaFile setSize: NSMakeSize (100, 100)];
[immagineDaFile unlockFocus];
NSData* theImageDataTemp = [immagineDaFile TIFFRepresentation];
NSBitmapImageRep* theImageRepresentation = [NSBitmapImageRep
imageRepWithData:theImageDataTemp];
NSDictionary* theProperties = [NSDictionary
dictionaryWithObject:[NSNumber numberWithFloat:0.9]
forKey:NSImageCompressionFactor];
NSData* theImageData = [theImageRepresentation
representationUsingType:NSJPEGFileType properties:theProperties];

[theImageData writeToFile: pathanteprima2
atomically: YES];

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Re: resize image with cocoa (From: Sergei Borodavkin <email@hidden>)
 >Re: resize image with cocoa (From: Francesca P <email@hidden>)
 >Re: resize image with cocoa (From: Francesca P <email@hidden>)

  • Prev by Date: Re: resize image with cocoa
  • Next by Date: Optimizing NSTreeController setContent: calls
  • Previous by thread: Re: resize image with cocoa
  • Next by thread: Re: resize image with cocoa
  • Index(es):
    • Date
    • Thread