M
Martin Maercker
Dear group,
I posted this question before but still don't have a clue why
DrawImage _occasionally_ drops pixels. I don't want to be pushy but
am under increasing time pressure to find a solution. So I hope
you'll pardon me for trying again under a catchier subject line.
I need to stretch a semitransparent, originally 1 pixel wide image to
a new width that is set 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.
"dynamicWidth" is the width that the output image is supposed to wind up
having.
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. Problem is, my application needs to be able to set
the exact size of the stretched image for all widths.
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
I posted this question before but still don't have a clue why
DrawImage _occasionally_ drops pixels. I don't want to be pushy but
am under increasing time pressure to find a solution. So I hope
you'll pardon me for trying again under a catchier subject line.
I need to stretch a semitransparent, originally 1 pixel wide image to
a new width that is set 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.
"dynamicWidth" is the width that the output image is supposed to wind up
having.
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. Problem is, my application needs to be able to set
the exact size of the stretched image for all widths.
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