Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Panel Background Image Repetition C#

Tags:

c#

image

panel

I want to place an image in a panel, but I do not want it repeated according to the size of the panel.

What I did is this:

panel3.BackgroundImage = picture1;

However, picture1 is repeated several times, since the panel is much wider than the actual picture.

What I want is to display the picture in its original form only. I don't want it repeated.

How can I do this? Thanks

like image 975
Clayton Avatar asked Dec 01 '25 09:12

Clayton


1 Answers

ImageLayout.Stretch; //make Image Fill the Control 
ImageLayout.None; //just put the image without any changes on size
ImageLayout.Center; //adjust location of image to be centered
ImageLayout.Tile; //repeat image
ImageLayout.Zoom; //re size image to be all viewed in the control (without stretch)
like image 147
hossam Avatar answered Dec 02 '25 23:12

hossam