Esempio n. 1
0
        private void label72_Click(object sender, EventArgs e)
        {
            Show_Color_Table sct1 = new Show_Color_Table( );

            sct1.CreateTable(ht2);
            sct1.Show( );
        }
Esempio n. 2
0
        private void label12_Click(object sender, EventArgs e)
        {
            tabControl2.SelectedIndex = 0;
            ofd1.ShowDialog( );
            pnlaction.Enabled = false;
            pb1.Image         = null;

            try
            {
                if (ofd1.FileName != "")
                {
                    Conf.strPath = ofd1.FileName;

                    if (Width > 700 || Height > 800)
                    {
                        MessageBox.Show("کاربر عزيز اندازه تصوير بزرگ است\nلطفا تصوير را کوچکتر کنيد و ان را لود کنيد", "اخطار"
                                        , MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }

                    if (new FileInfo(ofd1.FileName).Extension.ToString() != ".bmp")
                    {
                        MessageBox.Show("تصوير انتخاب شده مشکل دارد.لطفا دوباره سعي کنيد", "اخطار"
                                        , MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }

                    SoundPlayer sp1 = new SoundPlayer( );
                    sp1.SoundLocation = Application.StartupPath + "\\tick.wav";
                    sp1.PlayLooping( );

                    this.Enabled = false;
                    t2.Text      = Width.ToString( );
                    t1.Text      = Height.ToString( );
                    Conf.LoadPixel(ofd1.FileName, this, Width, Height, pgb1);
                    pgb1.BackColor = Color.White;
                    NewPicturePixel( );
                    mnulaghv_Click(null, null);
                    UnlockOption( );

                    if (Width % 2 != 0 || Height % 2 != 0)
                    {
                        lblshowmixture.Enabled = false;
                        groupBox2.Enabled      = false;
                    }
                    else
                    {
                        lblshowmixture.Enabled = true;
                    }
                    sp1.Stop( );
                    this.Enabled = true;
                    pb1.Image    = Image.FromFile(ofd1.FileName);
                    //Show Table Color
                    Hashtable ht1 = Conf.GetDuplicateValue(Conf.arr1);
                    ht2               = ht1;
                    txtcount.Text     = Conf.strCountColor;
                    blnIsCheckMixture = false;
                    Conf.SaveSetting("PicturePath", ofd1.FileName);
                    this.Text     = "Mixture Color Checker : " + ofd1.FileName;
                    ofd1.FileName = "";

                    SortColorlist(ht1);

                    if (chk3.Checked == true)
                    {
                        Show_Color_Table sct1 = new Show_Color_Table( );
                        sct1.CreateTable(ht1);
                        sct1.Show();
                    }
                    else
                    {
                        ShowColor sc1 = new ShowColor();
                        sc1.Location = new Point(72, 40);
                        pnlshowtable.Controls.Add(sc1);
                        sc1.PixelColor = ht1;
                        sc1.CreateColor( );
                    }
                }
                pb1.Image = Image.FromFile(picpath);
            }

            catch (Exception ex)
            {
                System.IO.File.AppendAllText(Application.StartupPath + "\\Error.txt", ex.Message.ToString( ));
            }
        }