This is a call to get the bitmap. the funciton is below:
picStop.Image = GetImage(ImageName.StopDisabled);
private Bitmap GetImage(ImageName i)
{
switch(i){
case ImageName.RecordDisabled:
return new
Bitmap(System.Reflection.Assembly.GetExecutingAsse mbly().GetManifestResource
Stream("C_SharpPDA.DictateDis.jpg"));
case ImageName.RecordEnabled:
return new
Bitmap(System.Reflection.Assembly.GetExecutingAsse mbly().GetManifestResource
Stream("C_SharpPDA.dictate.jpg"));
case ImageName.Recording:
return new
Bitmap(System.Reflection.Assembly.GetExecutingAsse mbly().GetManifestResource
Stream("C_SharpPDA.dictate.jpg"));
case ImageName.PlayEnabled:
return new
Bitmap(System.Reflection.Assembly.GetCallingAssemb ly().GetManifestResourceSt
ream("C_SharpPDA.play.jpg"));
case ImageName.PlayDisabled :
return new
Bitmap(System.Reflection.Assembly.GetCallingAssemb ly().GetManifestResourceSt
ream("C_SharpPDA.playinverted.jpg"));
case ImageName.StopDisabled :
return new
Bitmap(System.Reflection.Assembly.GetCallingAssemb ly().GetManifestResourceSt
ream("C_SharpPDA.stopdisabled.jpg"));
case ImageName.StopEnabled:
return new
Bitmap(System.Reflection.Assembly.GetCallingAssemb ly().GetManifestResourceSt
ream("C_SharpPDA.stop.jpg"));
}
return new
Bitmap(System.Reflection.Assembly.GetExecutingAsse mbly().GetManifestResource
Stream("C_SharpPDA.dictate.jpg"));
}
"Ed Sutton" <no****************@nomadics.com> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl...
I have been searching for how to get an icon resource and load it into an
ImageList. I added an *.ico file to my project and set the files "Build
Action" to "Embedded Resource". Is there any easy way to do this? This
was easy to do in the old MFC. I can not find the answer in C#.
I also need to embed an XML file into the resource and load it at run
time. I am hoping once I figure out how to load an icon resource then loading an
XML file will be similar.
Thanks in advance for any tips or suggestions,
-Ed