PictureBox BackgroundImage Property C#

纵饮孤独 提交于 2019-12-13 02:15:05

问题


can someone please refresh me how I can programatically set the background image of a picture box?

Thank you very much!


回答1:


Picture Box have both Image and Background Image Property

to set Background Image you have to set pictureBox1.BackgroundImage=your_Image;

and for Image property pictureBox1.Image=your_Image;




回答2:


PictureBox.Image

--Update

You need an image object. You can use the static function image.fromfile

PictureBox.Image = Image.FromFile(Path)



来源:https://stackoverflow.com/questions/4116743/picturebox-backgroundimage-property-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!