• 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
Resolution of an NSImage(Rep)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resolution of an NSImage(Rep)?


  • Subject: Resolution of an NSImage(Rep)?
  • From: Brian Postow <email@hidden>
  • Date: Thu, 5 Aug 2010 10:39:23 -0400

I have an NSImage. I want to save it with a CGImageDestination. the CGImageDestination wants a resolution.

I know that the NSImage is resolution independent, but I happen to  know that this image has only one NSImageRep. I also know that the image is bitmapdata. how do I get the resolution out of the NSImageRep?

I've seen:

([img size].width / [rep pixelWidth]) * 72

But that gives me 72 on an image that I know the resolution is actually 200 DPI.

The width/pixelWidth ARE correct (1696, which is what you get when you scan 8.5 inches at 200DPI) but since they're the same, I just get the 72...



Brian Postow
Senior Software Engineer
Acordex Imaging Systems

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Resolution of an NSImage(Rep)?
      • From: Graham Cox <email@hidden>
    • Re: Resolution of an NSImage(Rep)?
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: CGImage, CIImage and NSImage
  • Next by Date: calling a function in one class from another
  • Previous by thread: RE: NSWindow and setLevel
  • Next by thread: Re: Resolution of an NSImage(Rep)?
  • Index(es):
    • Date
    • Thread