• 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: Image loaded/displayed at the wrong size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image loaded/displayed at the wrong size


  • Subject: Re: Image loaded/displayed at the wrong size
  • From: Shawn Erickson <email@hidden>
  • Date: Sat, 15 Feb 2003 12:05:34 -0800

On Saturday, February 15, 2003, at 10:50 AM, Shawn Erickson wrote:

On Saturday, February 15, 2003, at 10:39 AM, Henri Hansen wrote:

But the dimensions of the shown picture are always too
small eg. a picture that should be 512 pixels wide is only some 200 pixels
wide.

In my codeI'm opening a picture by (as test picture I'm using a tif)

theImage = [[NSImage alloc]initWithData:someData]

But the image is shown at the wrong size.

Does the image file correctly describe it's dimensions or desired dimensions? Most likely but sometime that can be the source of a problem.

You didn't exactly say how you are drawing the image... is the thing you are drawing into only 200 pixels wide?

I put together a simple application to show what is one possible solution (you could use a scroll view instead, etc.) to the issue, that I think, you are seeing. This is a simple app that doesn't do some of the screen bounds and error checking needed, etc. It is just an example.

Simply drop a picture onto the applications window to get it displayed.

Application
http://homepage.mac.com/~shawnce/dev/examples/image_draw.app.tgz

Source/Project
http://homepage.mac.com/~shawnce/dev/examples/image_draw.tgz

-Shawn
_______________________________________________
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: Image loaded/displayed at the wrong size
      • From: Shawn Erickson <email@hidden>
References: 
 >Re: Image loaded/displayed at the wrong size (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Pixel Drawing Program 3
  • Next by Date: Re: Pixel Drawing Program 3
  • Previous by thread: Re: Image loaded/displayed at the wrong size
  • Next by thread: Re: Image loaded/displayed at the wrong size
  • Index(es):
    • Date
    • Thread