• 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
NSImage very strange
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage very strange


  • Subject: NSImage very strange
  • From: Benjohn <email@hidden>
  • Date: Wed, 22 Dec 2004 15:30:36 +0000


Hello there.

We've noticed some very odd effects in our application when painting from an NSImage.

The painting is done with:

[anImage drawInRect: dst fromRect: src operation: NSCompositeCopy fraction: 1.0];

The view the image is flipped, and is painted to a flipped view (other things draw in to the view and need it to be flipped). The painting is done in fairly small tiles (about 100x100 pixels).

We've noticed that for _some_ JPEG images (but no tiff images as far as we know):

* a very low resolution version of the image is being used so that it is interpolated up for display.
* the tiles are being drawn the right way up, but are being taken from the wrong (y inverted) part of the image.


I need to stress that this only seems to happen for some images, which is what's really odd about it. Other parts of our program use the raw pixel data in the images, and don't seem to have any trouble with the problem images.

The work around I have found is to:
	Load an image I
	Get a bitmap image rep from I.
	Create a new image J (of same size as I).
	Add the bitmap image rep to J

After this procedure, J seems to behave. Obviously this is a stupid approach :) I suspect that I'm misunderstanding some (or much) of what NSImage does. I'd like to know what's going wrong, and how it can be fixed without going through ridiculous hoops.

Cheers,
	Benjohn

_______________________________________________
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


  • Follow-Ups:
    • Re: NSImage very strange
      • From: "M. Uli Kusterer" <email@hidden>
    • Re: NSImage very strange
      • From: Jeff LaMarche <email@hidden>
  • Prev by Date: Re: NSArrayController and threading
  • Next by Date: Re: NSImage very strange
  • Previous by thread: Re: Problem with variable passing.
  • Next by thread: Re: NSImage very strange
  • Index(es):
    • Date
    • Thread