Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

How to resize the background image of a form

Dear Experts,

I have put a background image on a borderless form.
And wrote code to move and resize the form.
Everyting works great.

But when I resize the form the background image
doesn't resize too. In picture1 you see a borderless
form that hasn't resized yet. And picture 2 you see
what happens when you resize the form.

What can I fix this.?

Who knows the answer and is willing to help me?

Greetings,

Peter Kiers
Picture1.jpg
Picture2.jpg
ASKER CERTIFIED SOLUTION
Avatar of effes
effes
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dave Baldwin
Background images are pixel for pixel and don't resize , at least until CSS3.  Here http://css-tricks.com/766-how-to-resizeable-background-image/ are some techniques but I don't know if they will apply to what you are trying to do.

What has traditionally been done is to make the background image a slice that is tall enough to cover any height that you want and then let it repeat in the x-direction.
Avatar of Peter Kiers

ASKER

This is a Windows Form project.
and set the backgroundIMageLayout from Tile to scretch helps
but distor the image.

Peter Kiers
Sadly that's the effect when you stretch a bitmap.

If you just want to mimic a titlebar with the darker area at top you could put a panel there and give it the the color you want. Is that an option?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial