How to strech the background image in a MDI Parent form?

  • Thread starter Thread starter Georges Bessis
  • Start date Start date
G

Georges Bessis

The image I set as background are left at original size. In a picturebox, I
can decide to strech the image. Can I do that to fill my background ?

Regards

GB
 
Sorry, must be my english.

In a MDI Form, I use the BackgroundImage property to set up a given BMP
(or JPEG) image as background. My image file has a given size (width X
height).
What I get is :
1) or partial vue of the image if the client area is too small
2) or multiple vues of the image if the client area is bigger in size
that the image.

Instead, I want this image to be streched (expended) to fill my form's
client area, and "autosize" to it. How can I do that?

Is my question clear now?
 
Have not tried myself, but here's an idea:

You can place a PictureBox to fill out the form's client area and then add
all the controls you need inside that picture box..

Let me know whether it solved your problem.
 
Hi Sergey,

I had the same idea. I put a pictureBox in my MDIParent and set my picture
in the Image property, with the "sizemode" property to "StechImage".

As far as streching is concerned, it works fine, but I am having a big
problem in keeping my MyChild forms visible : the PictureBox on my MDIParent
stays on top of any child form, which is not really convenient for a
"background image"!

I tried to set my MDIChild forms as "Topmost" but it does not help.

Any suggestion?

GB


"Sergey Poberezovskiy" <[email protected]> a
écrit dans le message de (e-mail address removed)...
 
Hi again, Sergey,

My original problem comes from the fact that my image size is fixed, and the
client area is variable.

I know there are methods in Windows programming to transform an image size,
using some API. This could be the solution, I guess : upon form resize
event, reload and adapt the size of my image dynamically. Basically it will
be done once, since most of the time, my app is running full screen, so not
a real performance problem.

Once upon a time, I knew how to do that, but just can't remember now. Do you
have any idea?

Regards

GB



"Sergey Poberezovskiy" <[email protected]> a
écrit dans le message de (e-mail address removed)...
 
Sorry, cannot help you there - never played with graphics - will be
interested to know if you figured out a way though..

Best of luck,

Sergey
 
Back
Top