Re: tiff from NSImage, at 300 dpi
Re: tiff from NSImage, at 300 dpi
- Subject: Re: tiff from NSImage, at 300 dpi
- From: Todd Heberlein <email@hidden>
- Date: Mon, 8 Dec 2003 19:25:38 -0800
I figured out the problem by looking at some sample code written by
Marco Binder. Thanks Marco!!!
On Dec 8, 2003, at 6:43 PM, Todd Heberlein wrote:
// Get bitmap representation
data2 = [big_image TIFFRepresentation];
I needed to replace the line above with the lines below. I needed to
send a 'TIFFRepresentation' message to my image rep, then reset the
size.
image_rep = [NSBitmapImageRep
imageRepWithData: [big_image TIFFRepresentation]];
[image_rep TIFFRepresentation]; // flush
[image_rep setSize: orig_size]; // reset the size
data2 = [image_rep representationUsingType:NSTIFFFileType
properties:nil];
The same approach works for converting it to PNG at 300 dpi.
// Get bitmap representation
image_rep = [NSBitmapImageRep
imageRepWithData: [big_image TIFFRepresentation]];
[image_rep TIFFRepresentation]; // flush
[image_rep setSize: orig_size]; // reset the size
// convert to PNG representation
ditherTransparency = [NSNumber numberWithBool:YES];
propertyDict = [NSDictionary
dictionaryWithObject:ditherTransparency forKey:NSImageInterlaced];
data2 = [image_rep representationUsingType:NSPNGFileType
properties:propertyDict];
Cheers,
Todd
_______________________________________________
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.