public void SetImage(OutputPicture picture) { switch (picture) { case OutputPicture.None: this.pictureBox.Image = null; break; case OutputPicture.Exclamation: case OutputPicture.Info: case OutputPicture.Question: this.pictureBox.Image = GetImage(picture); break; } }
private Bitmap GetImage(OutputPicture picture) { Bitmap bmp = null; string name = string.Empty; try { switch (picture) { case OutputPicture.None: return(null); case OutputPicture.Exclamation: name = "Exclamation.gif"; break; case OutputPicture.Info: name = "Info.gif"; break; case OutputPicture.Question: name = "Question.gif"; break; } Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Netron.Neon.UI.Output." + name); bmp = Bitmap.FromStream(stream) as Bitmap; stream.Close(); stream = null; } catch (Exception exc) { Trace.WriteLine(exc.Message); } return(bmp); }