產生DLL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AddImg
{
public class Class1
{
public void mydll()
{
this.GetType().Assembly.GetManifestResourceStream("AddImg.image.test.jpg");
}
public System.IO.Stream ReturnStream()
{
return
this.GetType().Assembly.GetManifestResourceStream("AddImg.image.test.jpg");
}
}
}
主視窗
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace teatForm
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
AddImg.Class1 ca = new AddImg.Class1();
pictureBox1.Image = Image.FromStream(ca.ReturnStream());
}
}
}
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。