• 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
I want ALL my tiff pixels
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I want ALL my tiff pixels


  • Subject: I want ALL my tiff pixels
  • From: robert l clair <email@hidden>
  • Date: Wed, 12 Mar 2003 10:40:47 -0500 (EST)

#import "ExtendBitchingAboutUselesslySparseDocumentation.h"

I want *ALL* my pixels. I have (let's say) a 1200 pixel
square tiff created in Photoshop with a "resolution"
of 600 dpi. I read it into an NSImage using something like

NSImage* myImage = [[NSImage alloc] initWithContentsOfFile: @"myfile.tiff"];

I then draw it in a view with:

NSRect myRect = NSZeroRect;
NSPoint myPoint = NSZeroPoint;
myRect.size = [myImage size];
[myImage drawAtPoint: myPoint fromRect: myRect
operation: NSCompositeSourceAtop fraction: 1.0];

The result is an ugly 144 "pixels" square [really ugly
since my view bounds are scaled to give the real 101.4 dpi
of a powerbook, ie 72 points comes out an honest-measurable-
with-a-dimestore-ruler inch on the screen]. If I print it -
it prints 2 inches square with big blocky "pixels". If I
scaleup the view the ugliness scales.
A little investigation with the debugger reveals: The image has
a size of of 144 x 144. It has one representation with
a size of 144 x 144. pixelsHigh, pixelWide on the image rep admit
to being 1200.

What I want: I want all my 1200 x1200 pixels, and to know that the
resolution field says it's 600 dpi so that I can scale it
myself to what ever magnification I want and so that it will print
nicely.

All this works just fine with a GIF (well, you don't know the resolution,
so it is huge until you scale it down) but I have to be able
to read tiffs.

I'm not interested in NSImageView or NSImageCell - this is a general
graphics window and there is a lot of other stuff drawn there.

Any help with the correct incantation or pointers to better
documentation would be appreciated. Despite years of training
as a physicist, I'm getting a bit tired of the experimental
method.

......Thanks

Bob Clair

Extra Bonus Gripe: Why does everything (including the useless sample
code for this on the Apple site) report that screen resolution
is 72 ? I know that it fits conveniently with 72 points
per inch and that a generic VGA monitor can't tell you, but 100
dpi is more like it these days.

-------------------------------------------------------------
The Confusion is the gradient of the Potential for Confusion.
_______________________________________________
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.

  • Follow-Ups:
    • Re: I want ALL my tiff pixels
      • From: "Clark S. Cox III" <email@hidden>
    • Re: I want ALL my tiff pixels
      • From: Stéphane Sudre <email@hidden>
    • Re: I want ALL my tiff pixels
      • From: Marco Binder <email@hidden>
  • Prev by Date: Porting gov't Win sim to MacOS X
  • Next by Date: Getting the amount of free space on a volume
  • Previous by thread: Re: Help with crash
  • Next by thread: Re: I want ALL my tiff pixels
  • Index(es):
    • Date
    • Thread