Re: size of Picture Control
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 31 Jan 2007 15:16:40 -0500
See my answer to your "problem solved" posting (try to use the same subject line to make
tracking the responses easier).
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" <bauersachs@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
I need to display a small image in a dialog. So I used the Picture ControlJoseph M. Newcomer [MVP]
and sized it to the space I have in the dialog (VS2005 shows me 50x35). Then
I created an image of 50x35 pixel and saved it as bitmap, imported it into a
resource (where it reads 50x35 pixel), set the Picture Control to Type
Bitmap and selected in the Image field the bitmap resource. Now I have a
bitmap of 33x22 on the dialog, in other words much smaller than I wanted and
than I have drawn the bitmap. The switch Real Size Image has no effect. How
can I keep the image in the size I want?
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
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- size of Picture Control
- From: Eric
- size of Picture Control
- Prev by Date: Re: problem solved
- Next by Date: Re: Persisting Dynamic Bitmaps
- Previous by thread: Re: problem solved
- Next by thread: Re: CPropertySheet/Page
- Index(es):
Relevant Pages
|