Help with Macintosh programming

macintosh programming, mac programming, mac os programming, mac os x programming, mac programming language, mac programing

[Cocoa] how to display actual size of image in NSImageView?

I drag an image of size 700 x 900 pixels to the "images" tab of my .nib file
in Interface Builder, to add it to the project. Then I drag the added image
to an NSImageView. It looks a lot smaller, maybe about 300 x 400 pixels.
Even though the size of the NSImageView is set to the exact dimensions of
the image, and scaling is set to none. How do I make it show the image in
its actual size?

.
posted by admin in Uncategorized and have Comments (4)

4 Responses to “[Cocoa] how to display actual size of image in NSImageView?”

  1. admin says:

    In article <Unrud.173340$V41.131046@attbi_s52>,
     "Michael Szuchy" <vastud…@REMOVETHIScomcast.net> wrote:

    > I drag an image of size 700 x 900 pixels to the "images" tab of my .nib file
    > in Interface Builder, to add it to the project. Then I drag the added image
    > to an NSImageView. It looks a lot smaller, maybe about 300 x 400 pixels.
    > Even though the size of the NSImageView is set to the exact dimensions of
    > the image, and scaling is set to none. How do I make it show the image in
    > its actual size?

    Edit the image so that it says that its resolution is 72 dpi.


    David Phillip Oster

  2. admin says:

    Okay, that makes sense. But the images are jpegs and I don’t have access to
    the lossless source files, so I’m not sure how to change their dpi without
    recompressing. I guess I will read up on how to scale an image in code, so
    that I can magnify it to the actual size.

    "David Phillip Oster" <os…@ieee.org> wrote in message
    news:oster-34FB04.21114510122004@newssvr13-ext.news.prodigy.com…

    - Hide quoted text — Show quoted text -

    > In article <Unrud.173340$V41.131046@attbi_s52>,
    >  "Michael Szuchy" <vastud…@REMOVETHIScomcast.net> wrote:

    > > I drag an image of size 700 x 900 pixels to the "images" tab of my .nib
    file
    > > in Interface Builder, to add it to the project. Then I drag the added
    image
    > > to an NSImageView. It looks a lot smaller, maybe about 300 x 400 pixels.
    > > Even though the size of the NSImageView is set to the exact dimensions
    of
    > > the image, and scaling is set to none. How do I make it show the image
    in
    > > its actual size?

    > Edit the image so that it says that its resolution is 72 dpi.

    > —
    > David Phillip Oster

  3. admin says:

    I found numerous solutions to this problem in a search of cocoabuilder.com.
    I thought I had searched before posting but I guess I was using the wrong
    search terms.

    - Hide quoted text — Show quoted text -

    > Okay, that makes sense. But the images are jpegs and I don’t have access
    to
    > the lossless source files, so I’m not sure how to change their dpi without
    > recompressing. I guess I will read up on how to scale an image in code, so
    > that I can magnify it to the actual size.

    > "David Phillip Oster" <os…@ieee.org> wrote in message
    > news:oster-34FB04.21114510122004@newssvr13-ext.news.prodigy.com…
    > > In article <Unrud.173340$V41.131046@attbi_s52>,
    > >  "Michael Szuchy" <vastud…@REMOVETHIScomcast.net> wrote:

    > > > I drag an image of size 700 x 900 pixels to the "images" tab of my
    .nib
    > file
    > > > in Interface Builder, to add it to the project. Then I drag the added
    > image
    > > > to an NSImageView. It looks a lot smaller, maybe about 300 x 400
    pixels.
    > > > Even though the size of the NSImageView is set to the exact dimensions
    > of
    > > > the image, and scaling is set to none. How do I make it show the image
    > in
    > > > its actual size?

    > > Edit the image so that it says that its resolution is 72 dpi.

    > > —
    > > David Phillip Oster

  4. admin says:

    Here are the solutions I found. They are only proposed solutions, I have not
    tested any of them.

    http://www.cocoabuilder.com/archive/message/cocoa/2004/11/4/120777
    http://www.cocoabuilder.com/archive/message/cocoa/2003/3/12/85762
    http://www.cocoabuilder.com/archive/message/cocoa/2004/11/16/121755
    http://www.cocoabuilder.com/archive/message/cocoa/2001/12/16/43924

    - Hide quoted text — Show quoted text -

    > I found numerous solutions to this problem in a search of
    cocoabuilder.com.
    > I thought I had searched before posting but I guess I was using the wrong
    > search terms.

    > > Okay, that makes sense. But the images are jpegs and I don’t have access
    > to
    > > the lossless source files, so I’m not sure how to change their dpi
    without
    > > recompressing. I guess I will read up on how to scale an image in code,
    so
    > > that I can magnify it to the actual size.

    > > "David Phillip Oster" <os…@ieee.org> wrote in message
    > > news:oster-34FB04.21114510122004@newssvr13-ext.news.prodigy.com…
    > > > In article <Unrud.173340$V41.131046@attbi_s52>,
    > > >  "Michael Szuchy" <vastud…@REMOVETHIScomcast.net> wrote:

    > > > > I drag an image of size 700 x 900 pixels to the "images" tab of my
    > .nib
    > > file
    > > > > in Interface Builder, to add it to the project. Then I drag the
    added
    > > image
    > > > > to an NSImageView. It looks a lot smaller, maybe about 300 x 400
    > pixels.
    > > > > Even though the size of the NSImageView is set to the exact
    dimensions
    > > of
    > > > > the image, and scaling is set to none. How do I make it show the
    image
    > > in
    > > > > its actual size?

    > > > Edit the image so that it says that its resolution is 72 dpi.

    > > > —
    > > > David Phillip Oster