gdiplus: When copying an image do not round pixel positions up.

Dmitry Timoshkov dmitry at baikal.ru
Mon Aug 27 20:25:29 CDT 2012


Vincent Povirk <madewokherd at gmail.com> wrote:

> I know this looks wrong, but it's there for a reason, and it matches
> the behavior of the other interpolations. In my tests, the center of a
> bitmap pixel is at an integral value, meaning that the pixel at (0,0)
> is a rectangle extending from (-0.5, -0.5) to (0.5, 0.5), and if you
> enlarge an image you do get out-of-bounds bits on the lower right.
> 
> I'm pretty sure I also tested GdipDrawImageRect separately and got the
> same result.

In my tests (which replicate the behaviour of a target application) if
an image of say 10x10 pixels is being copied with a magnification world
transform then the destination image has right/bottom border completely
wrong, and my patch fixes this. Besides, bilinear interpolation does
exactly that already - doesn't round pixel positions up, which contradicts
your explanation.

-- 
Dmitry.



More information about the wine-devel mailing list