从资源文件读取图片

前端之家收集整理的这篇文章主要介绍了从资源文件读取图片前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

C#代码

@H_301_3@System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly(); // Note that the name for the embedded resource is case sensitive and must match the file name. Bitmap bmp = new Bitmap(asm.GetManifestResourceStream(asm.GetName().Name + "." + "pic.png")); e.Graphics.DrawImage(bmp,5,8,new Rectangle(0,bmp.Width,bmp.Height),GraphicsUnit.Pixel)



VB代码

猜你在找的VB相关文章