• 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: NSBitmapImageRep setSize: doesn't always do the right thing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBitmapImageRep setSize: doesn't always do the right thing


  • Subject: Re: NSBitmapImageRep setSize: doesn't always do the right thing
  • From: Steve Mills <email@hidden>
  • Date: Mon, 14 Mar 2016 20:38:55 +0000 (GMT)

On Mar 14, 2016, at 03:29 PM, Quincey Morris <email@hidden> wrote:

It’s not clear what your intention is, in trying to set the size of the image rep. It’s a NSBitmageImageRep, right? The pixels are the pixels are the pixels, so I don’t think you should be doing anything to the image *rep* size.
 
Normally, if you have a bitmap image (i.e. NSBitmageImageRep) that’s actually 88px x 107px, but you want to appear as 13pt x 16pt — note points not pixels — you would set the NSImage size to CGSize (13, 16)** and let the drawing system determine how to scale the pixel data to the perceived image size.

No, this is a proper way to set the resolution. It shouldn't affect the pixelWidth/pixelHeight. Documentation is sketchy, but I've seen it somewhere. Setting the image size after drawing into it was causing the image rep to lose pixels.
 
The other problem here is that you’re drawing the “hi-res” data at about 7x, which means that you’re guaranteeing some loss of detail when the image is scaled down to its final physical size (2x or 3x, or even 1x on a very old Mac). Why not draw it at the correct pixel resolution for the current display, so that there’s no actual pixel scaling (interpolation) needed when drawing? That should produce better quality than what you’re doing. (Unless you’re drawing something to be cached for multiple pixel resolutions, but even then there’s no hardware resolution higher than 3x).

This isn't being drawn to the display. The image is being placed into an InDesign document for export or print, so we need every bit of that resolution.

Sent from iCloud's ridiculous UI, so, sorry about the formatting

 
_______________________________________________

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


  • Prev by Date: Re: NSBitmapImageRep setSize: doesn't always do the right thing
  • Next by Date: Making Managed Object Context available to array controller in Storyboard scene
  • Previous by thread: Re: NSBitmapImageRep setSize: doesn't always do the right thing
  • Next by thread: Making Managed Object Context available to array controller in Storyboard scene
  • Index(es):
    • Date
    • Thread