Visual Studio2019 BackgoroundImageLayout属性

BackgroundImageLayout属性值

背景图片重复:BackgroundImageLayout属性设置为Tile(默认)

背景图片左边显示:BackgroundImageLayout属性设置为None

背景图片右边显示:BackgroundImageLayout属性设置为None,同时RightToLeft属性设置为Yes

背景图片居中显示:BackgroundImageLayout属性设置为Center

背景图片拉申:BackgroundImageLayout属性设置为Stretch

背景图片按比例放大到合适大小:BackgroundImageLayout属性设置为Zoom


Stretch与Zoom的区别

这里放一张原图:

这是BackgroundImageLayout属性设置为Stretch的样子:

 

窗体可以随意拉伸,背景图片会随着窗体改变而改变,会拉伸变形。保证窗体内部没有一点空白。

这是BackgroundImageLayout属性设置为Zoom的样子:

 窗体拉伸后,图片也会变化,但保持长宽比例不变,让图片不变形。以至于会出现上图中的空白部分

 

posted @ 2023-07-05 17:48  前进的老五  阅读(152)  评论(0编辑  收藏  举报