图片保存到dll中以及调用

it2022-05-09  33

在你的Dll中:public class mydll{public mydll(){    this.GetType().Assembly.GetManifestResourceStream( "yourDllName.yourImage.JPG" );}

public System.IO.Stream ReturnStream(){return this.GetType().Assembly.GetManifestResourceStream( "yourDllName.yourImage.JPG" );}}

注意要将图片yourImage.JPG 修改"生成方式"(Build Action)为"嵌入资源"(Embeded Resource)然后在要调用的程序中:private void Form1_Load(object sender, System.EventArgs e){    yourDllName.mydll   yy= new mydll();    pictureBox1.Image = Image.FromStream( yy.ReturnStream() );}

转载于:https://www.cnblogs.com/tuyile006/archive/2006/11/23/569816.html


最新回复(0)