Hi,
[Originally posted to microsoft.public.win32.programmer.gdi but it did
not gather much attention there. One poster suggested trying the
windowsforms group so that's what brings me here.]
I need to stretch a semitransparent, originally 1 pixel wide image to
a new width known only at runtime.
I use:
pGraphics->SetInterpolationMode(InterpolationModeNearestNeighbor);
pGraphics->SetPixelOffsetMode(PixelOffsetModeHalf);
pGraphics->DrawImage(pBmap,
Rect(x,y,
dynamicWidth,height),
0,0,width,height,
UnitPixel,0,0,0);
"width" and "height" are the width and height of the image to be stretched.
This works fine for most widths. For _some_ widths, however, the resulting
stretched image is one or two pixels too small. An example of such a width
is 480 pixels.
How can I make sure that DrawImage will produce an image of exactly the
specified size for every specified size?
Any help greatly appreciated,
Martin Maercker