0

I have a small project of a small game, so i have a Form and form background set to for example image1.jpg When i change the backgroudn to image2.jpg it auto-resizes it to 248x248 i think and then my background is small multiplied images.. My defaul image size is 700x700, same as the form is. THe commands are use are

Image myimage = new Bitmap(@"C:\Users\sdsd\Desktop\Iconscollection\images(2).jpg");
this.BackgroundImage = myimage;

So how exactly i make it to change instantly to 700x700?

0

1 Answer 1

2

Use

this.BackgroundImageLayout = ImageLayout.Stretch

https://msdn.microsoft.com/en-us/library/system.windows.forms.imagelayout(v=vs.110).aspx

Sign up to request clarification or add additional context in comments.

2 Comments

@Striller There is nothing to be explained. The answer is giving you a hint, you could go and read the documentation.
@Striller Basically, this (the form) has a BackgroundImageLayout property. The command here is setting that property to ImageLayout.Stretch. ImageLayout is an enumeration that has several members including Zoom, Center, Tile, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.