private void LoadImage(string path) { using (Bitmap picture1 = new Bitmap(path)) { using (Bitmap picture2 = new Bitmap(picture1, CONST.bitmapWidth, CONST.bitmapHeight)) { picture = SettingColorValues.GetColorsTable(picture2, CONST.bitmapWidth, CONST.bitmapHeight); } } loadedPicture = LoadedPicture.picture; pictureBox1.Invalidate(); }
private void Form1_Load(object sender, EventArgs e) { //Loading bitmaps using (Bitmap sample11 = new Bitmap("../../Samples/Picture1.jpg")) using (Bitmap sample12 = new Bitmap(sample11, CONST.bitmapWidth, CONST.bitmapHeight)) { sample1 = SettingColorValues.GetColorsTable(sample12, CONST.bitmapWidth, CONST.bitmapHeight); } using (Bitmap sample21 = new Bitmap("../../Samples/Picture2.jpg")) using (Bitmap sample22 = new Bitmap(sample21, CONST.bitmapWidth, CONST.bitmapHeight)) { sample2 = SettingColorValues.GetColorsTable(sample22, CONST.bitmapWidth, CONST.bitmapHeight); } using (Bitmap sample31 = new Bitmap("../../Samples/Picture3.jpg")) using (Bitmap sample32 = new Bitmap(sample31, CONST.bitmapWidth, CONST.bitmapHeight)) { sample3 = SettingColorValues.GetColorsTable(sample32, CONST.bitmapWidth, CONST.bitmapHeight); } using (Bitmap sample41 = new Bitmap("../../Samples/Picture4.bmp")) using (Bitmap sample42 = new Bitmap(sample41, CONST.bitmapWidth, CONST.bitmapHeight)) { sample4 = SettingColorValues.GetColorsTable(sample42, CONST.bitmapWidth, CONST.bitmapHeight); } using (Bitmap sample51 = new Bitmap("../../Samples/Picture5.jpg")) using (Bitmap sample52 = new Bitmap(sample51, CONST.bitmapWidth, CONST.bitmapHeight)) { sample5 = SettingColorValues.GetColorsTable(sample52, CONST.bitmapWidth, CONST.bitmapHeight); } //Load K-values Kr = (int)numericUpDown1.Value; Kg = (int)numericUpDown2.Value; Kb = (int)numericUpDown3.Value; K = (int)numericUpDown4.Value; //ProgressBar invisible progressBar1.Visible = false; }