NSImage very strange
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