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

Dmitry Timoshkov dmitry at baikal.ru
Mon Aug 27 20:43:06 CDT 2012


Vincent Povirk <madewokherd at gmail.com> wrote:

> > 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.
> 
> The same rule about pixel centers applies with bilinear interpolation.
> That means that at the lower-right corner of a stretched image you end
> up with places where the lower-right pixel was blended with a pixel
> from outside the image.

Just write a test with GdipDrawImageI and scenario described above and
you will see the problem. In my case it's even more visible because of
indirect magnifaction: image with resolution 100 dpi is being copied to
device with 300 dpi.

-- 
Dmitry.



More information about the wine-devel mailing list