• 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: tiff from NSImage, at 300 dpi
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >tiff from NSImage, at 300 dpi (From: Todd Heberlein <email@hidden>)

  • Prev by Date: How to measure the width of text?
  • Next by Date: Re: How to measure the width of text?
  • Previous by thread: tiff from NSImage, at 300 dpi
  • Next by thread: How to measure the width of text?
  • Index(es):
    • Date
    • Thread