D
DaveL
Hello
I use the Below code to Extract Images from the Executing Assemblys
Resource....
What i would like to know is
I have other images in another dll and this dll is referenced in the
application
How to Get to The Dlls Resources From the Executing Assembly
public static Bitmap GetImage(string ImageName,int Width,int Height)
{
Bitmap oBitMap = null;
Icon oIcon = null;
Stream BitStream = null;
Assembly assembly = Assembly.GetExecutingAssembly();
string IconName = string.Format("{0}.{1}",
assembly.GetName().Name, ImageName.ToUpper());
if (ImageName.IndexOf("ICO") > -1)
{
BitStream = assembly.GetManifestResourceStream(IconName);
oIcon = new Icon(BitStream, 32, 32);
oBitMap = oIcon.ToBitmap();
}
else
{
BitStream = assembly.GetManifestResourceStream(IconName);
oBitMap = new Bitmap(BitStream);
oBitMap = new Bitmap(oBitMap, Width, Height);
}
oIcon = null;
BitStream = null;
return oBitMap;
}
I use the Below code to Extract Images from the Executing Assemblys
Resource....
What i would like to know is
I have other images in another dll and this dll is referenced in the
application
How to Get to The Dlls Resources From the Executing Assembly
public static Bitmap GetImage(string ImageName,int Width,int Height)
{
Bitmap oBitMap = null;
Icon oIcon = null;
Stream BitStream = null;
Assembly assembly = Assembly.GetExecutingAssembly();
string IconName = string.Format("{0}.{1}",
assembly.GetName().Name, ImageName.ToUpper());
if (ImageName.IndexOf("ICO") > -1)
{
BitStream = assembly.GetManifestResourceStream(IconName);
oIcon = new Icon(BitStream, 32, 32);
oBitMap = oIcon.ToBitmap();
}
else
{
BitStream = assembly.GetManifestResourceStream(IconName);
oBitMap = new Bitmap(BitStream);
oBitMap = new Bitmap(oBitMap, Width, Height);
}
oIcon = null;
BitStream = null;
return oBitMap;
}