Fractional positions for drawing images on 10.4
Fractional positions for drawing images on 10.4
- Subject: Fractional positions for drawing images on 10.4
- From: Ben Haller <email@hidden>
- Date: Sat, 17 Jun 2006 18:00:51 -0700
Hi all! I've recently noticed what appears to be a change in the
behavior of NSImage. When an image is drawn using -[NSImage
drawInRect:fromRect:operation:fraction:], and the destination rect
has a fractional (i.e. non-integer) origin or size, it used to be
(10.3.9 and before) that it would get drawn "smoothly" -- the
fractional information would be used to produce an antialiased
approximation of the requested destination rect. Now (10.4.6), it
appears that the coordinates of the destination rect simply get
rounded (or floored, or something) to the nearest integer, or that's
what appears to be happening in my app. I can take the same binary,
run it on the two releases, and see the two different behaviors, so
I'm pretty sure I'm not seeing ghosts. I haven't tried it on
releases between 10.3.9 and 10.4.6.
This means that where you used to be able to "slide" an image very
smoothly from one point to another, using sub-pixel destination rects
to smooth out the motion even from one pixel to the next, now the
image "jumps" from pixel to pixel. This is quite unfortunate, in the
app I'm working on.
I can't find any information in the docs or release notes about
this, although I suspect it has to do with the resolution-
independency stuff that Apple has been adding; my guess is that
because of that stuff, they're expecting a lot more blits to
fractional coordinates, and so they "optimized" those blits by
rounding off the rects. I can't find a way to get the old behavior
back; the NSGraphicsContext flags that might apply
(setImageInterpolation:NSImageInterpolationHigh,
setShouldAntialias:YES) seem to have no effect. I haven't explored
going down a level to CIImage or something; I've never worked with
those APIs before, so I thought I'd ask here first.
Anybody have any information on this? I can think of a way to
work around the problem in my app, but it will be exceedingly messy...
Ben Haller
Stick Software
_______________________________________________
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