I know that dialogs are in dialog units, and that the picture resizes with
the dialog would be ok. I don't want to write any code to resize the image
(if necessary I'll redraw the image in an image program). What can I do?
Eric
AliR.
"Eric" <bauer...@kull.ch.cuthere.nospam.me.com> wrote in message
news:ePsZDN9...@TK2MSFTNGP02.phx.gbl...
Eric
There are two approaches to this problem. The simplest one is to simply resize the bitmap
object (e.g., the CStatic) dynamically to fit the bitmap. The slightly more complex
approach is to resize the bitmap to the size of the control, using StretchBlt (which often
produces ugly effects if there is a serious size mismatch). The third solution is to have
a suite of images in various sizes; choose the image nearest in size and then apply one of
the two previous solutions.
While you can consider doing conversions using Dialog Box Units, but this is typically
unnecessary.
joe
On Mon, 29 Jan 2007 19:43:30 +0100, "Eric" <bauer...@kull.ch.cuthere.nospam.me.com>
wrote:
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
You have confused dialog box units (DBUs) with pixels. As I mention in my answer,
redrawing the image to fit the picture control area precisely is doomed, and is a
completely unacceptable solution if you ever plan to run your program on any other machine
in the known universe, or at any time upgrade your machine, change its display,
resolution, or default font.
I find fewer unpleasant artifacts by making large images smaller than small images larger
when I use StretchBlt. But at no time would I consider redrawing the image to "fit
precisely" as a viable solution. It won't work except in one, and only one, precise case.
All attempts to redraw the image will require that you create one image for each possible
combination of display screen size, display resolution, video card vendor, and version of
display driver, for all possible settings of default fonts. This means a lot of pictures.
That's probably about 8 screen resolutions, 6 screen sizes, 3 font sizes, and that means
124 pictures, and I've probably missed a few. And that doesn't even take into account the
idiosyncrasies of display cards and drivers.
joe
On Mon, 29 Jan 2007 19:27:48 +0100, "Eric" <bauer...@kull.ch.cuthere.nospam.me.com>
wrote: