Beispiel #1
0
        private void setData(BmpUnpack bmp, string file, bool updateImage = true)
        {
            if (processing)
            {
                return;
            }
            this.currentFilePath = file;
            this.Text            = currentFilePath;
            if (updateImage)
            {
                myPictureBox.ImageLocation = currentFilePath;
            }
            if (this.bmp == null)
            {
                bmp.Unpack(file, Application.StartupPath);
                this.bmp        = bmp;
                imageRender.BMP = bmp;
                imgSlice.BMP    = bmp;
            }
            else
            {
                if (!this.bmp.Equals(bmp))
                {
                    bmp.Unpack(file, Application.StartupPath);
                    this.bmp = bmp;

                    imgSlice.BMP    = bmp;
                    imageRender.BMP = bmp;
                }
            }
            // MessageBox.Show(this.bmp.colorCountList.Sun().ToString());
        }
        public ColorCountControl(BmpUnpack bmp)
        {
            InitializeComponent();
            //this.colorList = colorList;
            this.bmp         = bmp;
            this.label1.Text = bmp.FilePath.Substring(bmp.FilePath.LastIndexOf('\\') + 1);
            toolTip1.SetToolTip(this.label1, bmp.FilePath);
            //this.filePath = file;


            CreateColorPanel();
            SizeChange();
        }
Beispiel #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            List <ColorTagged> list = SaveLoadColorList.Load($"{Application.StartupPath}\\swatche.xml");

            if (list == null)
            {
                return;
            }
            for (int i = 0; i < list.Count; i++)
            {
                this.colorList.Add(list[i]);
            }
            this.colorList.Sort();
            this.bmp        = new BmpUnpack(this.colorList);
            imageRender.BMP = this.bmp;
            imgSlice.BMP    = bmp;
            start("C:\\Users\\bonus\\OneDrive\\Ambiente de Trabalho\\8 METROS TAQUEADO PARA CONTAGEM .bmp");
            //btn_process_Click(null, null);
        }
Beispiel #4
0
        private void processFile(string file)
        {
            BmpUnpack tempbmp = new BmpUnpack(colorList);

            setData(tempbmp, file);
            //ColorCountControl ccc = new ColorCountControl(bmp.colorCountList,this.currentFilePath);
            ColorCountControl ccc = new ColorCountControl(tempbmp);

            //ccc.Dock = DockStyle.Top;
            ccc.Click += (b) => {
                setData(b, b.FilePath);
            };
            ccc.ColorClick += (sender, bm) =>
            {
                setData(bm, bm.FilePath, false);

                DrawColor((int)sender.Tag);
                textBox_colorHex.Text = HexConverter(sender.BackColor);
            };
            flowLayoutPanel_counter.Controls.Add(ccc);
        }