标签:main containe pen tco 文件夹 内存流 rom stream ret
if (File.Exists("mainbg.png"))//判断当前文件夹下图片是否存在
{
using (FileStream fs = new FileStream("mainbg.png",FileMode.Open))
{
int len = (int)fs.Length;
byte[] buf = new byte[len];
fs.Read(buf, 0, len);
MemoryStream ms = new MemoryStream();
ms.Write(buf,0,len);
splitContainer.Panel2.BackgroundImage = Image.FromStream(ms);
splitContainer.Panel2.BackgroundImageLayout = ImageLayout.Stretch;
}
}
标签:main containe pen tco 文件夹 内存流 rom stream ret
原文地址:https://www.cnblogs.com/GY66520/p/12129313.html