Re: resize image with cocoa
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
imageRepWith
Data: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