How do you specify the compression amount for an image representation?
How do you specify the compression amount for an image representation?
- Subject: How do you specify the compression amount for an image representation?
- From: John Blackburn <email@hidden>
- Date: Mon, 18 Feb 2002 13:34:45 -0800
I have a NSBitmapImageRep; I want to create a compressed thumbnail of
it . Which properties must be specified when creating JPG or PNG
representations from an NSBitmapImageRep?
The likeliest property I've been able to find is
NSImageCompressionFactor, but either it doesn't work, or I'm not using
it correctlyprobably the latter because the documentation is scant,
scattered, and occasionally contradictory.
data = [rep representationUsingType:NSPNGFileType // or
NSJPEGFileType
properties:[NSDictionary
dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:1.0],
NSImageCompressionFactor, nil]];
The image I get back is always the same size in bytes, seemingly
ignoring the property and numberWithFloat value altogether. What's the
correct usage of this property, and are there others which must be
specified as well?
Thanks,
John Blackburn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.