Re: size of Picture Control

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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 Control
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

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Problem while Displaying Bitmap OnInitDialog()
    ... > i have to display a bitmap when a dialog initializez. ... > picture on button click but its not working when i write the same code ... Try moving your bitmap display code ...
    (microsoft.public.vc.mfc)
  • Problem while Displaying Bitmap OnInitDialog()
    ... i have to display a bitmap when a dialog initializez. ... picture on button click but its not working when i write the same code ...
    (microsoft.public.vc.mfc)
  • images using graphics class
    ... I'm trying to create a bitmap and then use outputstream to display the ... characters in the page instead of a picture... ... I put this before the outputstream but it didn't make any difference, ...
    (microsoft.public.dotnet.general)
  • images using graphics class
    ... I'm trying to create a bitmap and then use outputstream to display the ... characters in the page instead of a picture... ... I put this before the outputstream but it didn't make any difference, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Zoom in/ Zoom out images
    ... Picture control in the same dialog. ... As soon as you leave this function the destructor is called and the bitmap object is ... The drawing must be done in the OnPaint handler. ...
    (microsoft.public.vc.mfc)