• 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: NSImage Size Discrepancies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage Size Discrepancies


  • Subject: Re: NSImage Size Discrepancies
  • From: patrick machielse <email@hidden>
  • Date: Sun, 13 Mar 2005 14:29:40 +0100

Op 13-mrt-05 om 14:10 heeft Dan Saul het volgende geschreven:

Hello there, I have an NSImage I create at run time of an image
(http://catsdorule.torpedobird.com/img/blogpix/husky.jpg) all my code
works except for one small problem. The Size of the NSImage is
different then the actual image, running NSLog(@"%f",[backgroundImage
size].width); shows that the width is 245.759995 when infact it is
1024.

Is there any way to fix this or to get the actual size so I can set it manually?

Your image is 300 dpi. NSImage reports the size in a 72 dpi coordinate system: 1024 * 72 / 300 = 245.76 units. The best solution is to make your code cope with this elegantly (see other post), but you could also convert your picture to 72 dpi using a graphics program.


patrick

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Database field editors
  • Next by Date: Mac OS X Programming
  • Previous by thread: Re: NSImage Size Discrepancies
  • Next by thread: contextual menu question (newbie)
  • Index(es):
    • Date
    • Thread