Ejemplo n.º 1
0
        public ImageBoxCapture LoadFromFile(string FileName)
        {
            ImageBoxCapture result   = null;
            bool            BreakAll = false;

            for (int rw = 0; rw <= this.tlpImages.RowCount - 1; rw++)
            {
                for (int col = 0; col <= this.tlpImages.ColumnCount - 1; col++)
                {
                    result = (ImageBoxCapture)this.tlpImages.GetControlFromPosition(col, rw);
                    if (result != null)
                    {
                        if (result.Image == null)
                        {
                            result.LoadFromFile(FileName);
                            BreakAll = true;
                            break;
                        }
                    }
                }

                if (BreakAll)
                {
                    break;
                }
            }

            if (AfterLoadFromFile != null)
            {
                AfterLoadFromFile(this, result, FileName);
            }

            return(result);
        }
Ejemplo n.º 2
0
        void ImageBox_MouseClick(object sender, MouseEventArgs e)
        {
            if (this.selected != null)
            {
                this.selected.GridColor          = this.colorsUnSelected[0];
                this.selected.GridColorAlternate = this.colorsUnSelected[1];
            }

            this.selected = (ImageBoxCapture)sender;

            this.selected.GridColor          = this.colorsSelected[0];
            this.selected.GridColorAlternate = this.colorsSelected[1];

            if (this.AfterImageClick != null)
            {
                this.AfterImageClick(this);
            }
        }
Ejemplo n.º 3
0
        public ImageBoxCapture LoadFromFile(string FileName, bool Select = true)
        {
            try
            {
                ImageBoxCapture result = LoadFromBitmap(new Bitmap(FileName), FileName);

                if (result != null)
                {
                    result.Selected = Select;
                }

                return(result);
            }
            catch (Exception ex)
            {
                ACSLog.InsertLog(MessageBoxIcon.Error, ex);
                return(null);
            }
        }
Ejemplo n.º 4
0
        ImageBoxCapture NewImageBox(int Column, int Row)
        {
            var result = new ImageBoxCapture(Column, Row);

            result.Dock               = DockStyle.Fill;
            result.GridDisplayMode    = ImageBoxGridDisplayMode.Client;
            result.SaveImageEdition   = true;
            result.GridColor          = this.ColorsUnSelected[0];
            result.GridColorAlternate = this.ColorsUnSelected[1];
            result.AutoPan            = true;
            result.AllowClickZoom     = false;
            result.AllowZoom          = true;


            result.MouseClick  += this.ImageBox_MouseClick;
            result.KeyDown     += this.ImageBox_KeyDown;
            result.ZoomChanged += this.ImageBox_ZoomChanged;

            return(result);
        }