You can get a list of Embedded resources (Images, etc) within a .NET application using the following code:

System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames()

Then, if you'd like to display that image in (for example) an Excel Sheet cell, you can use the following:

 

Workbookwb = objExcel.ActiveWorkbook;

Worksheet sheet = (Worksheet)wb.Sheets[1];

Range rng = sheet.get_Range("V2", "V2");

System.IO.Stream myStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("<EmbeddedResourceNameGoesHERE.jpg>");

System.Drawing.Image img = null;

img = System.Drawing.Image.FromStream(myStream);

forms.Clipboard.SetImage(img);

rng.Select();

sheet.Paste(System.Type.Missing, System.Type.Missing);

Advertisements