docschnipp
2004-12-08 07:21:02 UTC
Hi,
I am loading PNG files with the Gdiplus::Bitmap(filename) constructor. To
display
them I create a CompatibleBitmap(). In case the resolution(DPI) of the
bitmap/PNG does not match the resolution (DPI) of the screen context
(accessed via Gdiplus::Graphics) the bitmaps are drawn scaled. It only works
"pixelwise" when the resolutions of the PNG file and the desktop match.
I call this DrawImage() method:
DrawImage(Image, dx,dy, sx,sy,sw,sh, UnitPixel);
which is the only suitable option in this case, since I need to draw only
parts of the bitmap. Since every other part of the GUI is fixed I need also
fixed drawing.
I tried to call bitmap.SetResolution() but after this the
Gdiplus::Graphics::DrawImage() function returns "InvalidParameter".
How can I make GDI+ ignoring the DPI within the file and just use the pixels?
I don't want to scale sw/sh every time I call it.
thanks for any answer
docschnipp
I am loading PNG files with the Gdiplus::Bitmap(filename) constructor. To
display
them I create a CompatibleBitmap(). In case the resolution(DPI) of the
bitmap/PNG does not match the resolution (DPI) of the screen context
(accessed via Gdiplus::Graphics) the bitmaps are drawn scaled. It only works
"pixelwise" when the resolutions of the PNG file and the desktop match.
I call this DrawImage() method:
DrawImage(Image, dx,dy, sx,sy,sw,sh, UnitPixel);
which is the only suitable option in this case, since I need to draw only
parts of the bitmap. Since every other part of the GUI is fixed I need also
fixed drawing.
I tried to call bitmap.SetResolution() but after this the
Gdiplus::Graphics::DrawImage() function returns "InvalidParameter".
How can I make GDI+ ignoring the DPI within the file and just use the pixels?
I don't want to scale sw/sh every time I call it.
thanks for any answer
docschnipp