Image view

I am working on a project that displays images.
The problem is: If an image is 300 dpi and has a size of two inches, the program displays it as a two inches small image instead of presenting it as were it a 72 dpi image like Photoshop and most image viewers do.
So my question is: Is there any way to display the image in 72 dpi instead of a tiny image of originally 300 dpi?

Thanks in advance,


As you probably know, the image size and proportion is governed by the settings in IB in the ‘attributes’ pane of the image view’s info window. The image view itself has no knowledge or control over the resolution… i.e. you can’t just say “display at 72dpi”. The image view either displays it as it’s raw data is read, or it uses it’s scaling algorithm to come up with the “best possible” rendering of the original within the bounds of the view. The “Scaling” setting in IB will allow you to do some basic dynamic manipulation of the image, but you’re probably going to need some more powerful setup to handle a wider spectrum of images and sizes.

So, you could do a variety of things. You could do some math on the size/resolution of the image, and adjust the size of the image view itself to display the original image in a size close to what would be it’s 72 dpi size. This has some obvious limitations.

Another option would be to get into cocoa, and create an NSImage programmatically and dump that into the image view.

Yet another option would be to actually create a second image from the first that was the correct resolution, and then display that. Copy the image to a tmp file, display it in the image view, and then delete it once it’s no longer needed.

To help manipulate images you could script a third party app, and Image events can also easily handle basic adjustments and read current info for your images.

Hope that helps, somehow… :slight_smile: