• 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
Problem with NSImage and .PNG file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with NSImage and .PNG file


  • Subject: Problem with NSImage and .PNG file
  • From: Matt <email@hidden>
  • Date: Fri, 15 Aug 2008 13:54:32 -0700

I have an image that is 7200x32 pixels, which is used to store a series of
32x32 tiles. When drawing from this NSImage, the further towards the end of
the image (right edge) the subrect goes, the blurrier it gets drawn.

Changing the original image file to a TIFF resulted in the subrects being
drawn properly (clean, non-blurry). But drawing from an NSImage made from a
.PNG, the subrects came out blurry again.

I found that the .PNG NSImage was returning a width of 7199.099 pixels,
instead of 7200. Manually setting the NSImage's width to 7200 before drawing
fixed this issue and resulted in the correct, non-blurry subrectangles being
drawn.

Has anyone encountered this issue before? Is this a bug within NSImage's
handling of PNG's or could this be a problem with my image file itself, a
DPI issue perhaps?

Any feedback or info is appreciated. Thank you,
-Matt
_______________________________________________

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

  • Follow-Ups:
    • Re: Problem with NSImage and .PNG file
      • From: Graham Cox <email@hidden>
  • Prev by Date: arch: posix_spawnp: /Developer/Tools/otest: Bad CPU type in executable
  • Next by Date: Context and the drawing of NSImages
  • Previous by thread: Re: Race in Apple's NSTreeContoller/NSOutlineView
  • Next by thread: Re: Problem with NSImage and .PNG file
  • Index(es):
    • Date
    • Thread