public string Version = "8.0"; //Software Version. #endregion Fields #region Constructors public Form1() { SplashScreenForm frm = new SplashScreenForm(); frm.Show(); InitializeComponent(); cmbxOm.Enabled = false; cmbxEkh.Enabled = false; lblVer.Text = "Version " + Version; this.pictureBox5.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox5_Paint); cmboxrshow.SelectedIndex = 0; try { string imageaddress = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.ToString()) ; pictureBox7.Image = new Bitmap(imageaddress + @"\resources\images\background.jpg"); pictureBox1.Image = new Bitmap(imageaddress + @"\resources\images\panelom.jpg"); pictureBox2.Image = new Bitmap(imageaddress + @"\resources\images\panelekh.jpg"); closepressed.Image = new Bitmap(imageaddress + @"\resources\images\exitpressed.png"); close.Image = new Bitmap(imageaddress + @"\resources\images\exit.png"); pictureBox6.Image = new Bitmap(imageaddress + @"\resources\images\titlebar.jpg"); pictureBox8.Image = new Bitmap(imageaddress + @"\resources\images\ScribbleArt.jpg"); pictureBox4.Image = new Bitmap(imageaddress + @"\resources\images\accept.jpg"); pictureBox3.Image = new Bitmap(imageaddress + @"\resources\images\sendtoafriend.jpg"); } catch (Exception) { if (MessageBox.Show("Error loading resources,please reinstall the program!", "Resource error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.OK) { Application.Exit(); } } }
public Form1() { SplashScreenForm frm = new SplashScreenForm(); frm.Show(); InitializeComponent(); cmbxOm.Enabled = false; cmbxEkh.Enabled = false; lblVer.Text = "Version " + Version; cmboxrshow.SelectedIndex = 0; sliderBgBuffer = new Bitmap(senseSlider1.Width, senseSlider1.Height); sliderBgGraphics = Graphics.FromImage(sliderBgBuffer); // Fetch the embedded Image Resources (the Slider Icons) Assembly assembly = Assembly.GetExecutingAssembly(); var imageNames = assembly.GetManifestResourceNames().Where(r => r.Contains("icon") && r.EndsWith(".png")).OrderBy(r => r); // Add the png Files to the Slider (as MemoryStreams, because the Slider loads the Images itself to keep the alpha values) foreach (string m in imageNames) senseSlider1.AddIcon((MemoryStream)assembly.GetManifestResourceStream(m)); // load the big icons for the overlay LunaticShade.Imaging.IImagingFactory factory = LunaticShade.Imaging.CreateFactory(); imageNames = assembly.GetManifestResourceNames().Where(r => r.Contains("big") && r.EndsWith(".png")).OrderBy(r => r); foreach (string m in imageNames) overlayImages.Add(LunaticShade.Imaging.LoadImageFromStream((MemoryStream)assembly.GetManifestResourceStream(m), factory)); InitGUI(); try { string imageaddress = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.ToString()); pictureBox7.Image = new Bitmap(imageaddress + @"\resources\images\background.jpg"); pictureBox1.Image = new Bitmap(imageaddress + @"\resources\images\panelom.jpg"); pictureBox2.Image = new Bitmap(imageaddress + @"\resources\images\panelekh.jpg"); closepressed.Image = new Bitmap(imageaddress + @"\resources\images\exitpressed.png"); close.Image = new Bitmap(imageaddress + @"\resources\images\exit.png"); pictureBox6.Image = new Bitmap(imageaddress + @"\resources\images\titlebar.jpg"); pictureBox8.Image = new Bitmap(imageaddress + @"\resources\images\ScribbleArt.jpg"); pictureBox4.Image = new Bitmap(imageaddress + @"\resources\images\accept.jpg"); pictureBox3.Image = new Bitmap(imageaddress + @"\resources\images\sendtoafriend.jpg"); } catch (Exception) { if (MessageBox.Show("Error loading resources,please reinstall the program!", "Resource error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.OK) { Application.Exit(); } } }