
















string fileName = @"C:\1.jpg";
try {
using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) {
using (BinaryReader br = new BinaryReader(fs)) {
byte[] bytes = br.ReadBytes((int)fs.Length);
MemoryStream ms = new MemoryStream(bytes);
}
}
this.BackgroundImage = Image.FromStream(ms);
} catch (Exception ex) {
logger.Warn(ex);
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。