面板背景图像重复C#
我想在面板中放置一个图像,但我不想根据面板的大小重复它 我所做的是:面板背景图像重复C#,c#,image,panel,C#,Image,Panel,我想在面板中放置一个图像,但我不想根据面板的大小重复它 我所做的是: panel3.BackgroundImage = picture1; 但是,图1重复了几次,因为面板比实际图片宽得多 我想要的是仅以原始形式显示图片。我不想让它重复 我该怎么做?谢谢试试看 panel3.BackgroundImageLayout = ImageLayout.Stretch; 这将停止重复并将图像拉伸到整个面板。如果不希望图像拉伸,请尝试ImageLayout.Center您可以将BackgroundIma
panel3.BackgroundImage = picture1;
但是,图1重复了几次,因为面板比实际图片宽得多
我想要的是仅以原始形式显示图片。我不想让它重复
我该怎么做?谢谢试试看
panel3.BackgroundImageLayout = ImageLayout.Stretch;
这将停止重复并将图像拉伸到整个面板。如果不希望图像拉伸,请尝试
ImageLayout.Center
您可以将BackgroundImageLayout
设置为Center
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)