How can I programmatically set the image of a panel to a jpg file (a non BMP), that is not in resources?
I know how to set it to a BMP file(not in resources) or a resource file, but how to set it to a JPG file (not in resources)?
您可以使用Image.FromFile
或Image.FromStream
加载图像,然后将其设置为面板的背景图像:
this.panel1.BackgroundImage = Image.FromFile(@"d:\image.jpg");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.