Beispiel #1
0
        public void Ref()
        {
            Pen pen = new Pen(Color.Black, 1f);

            this.dimgpic = null;
            this.Clearpic();
            if (this.Myapp != null)
            {
                try
                {
                    imagesizexytype imagesizexytype = new imagesizexytype
                    {
                        x      = 0,
                        y      = 0,
                        width  = 0,
                        height = 0
                    };
                    if (this.panel1.Width > 24)
                    {
                        for (int i = 0; i < this.Myapp.images.Count; i++)
                        {
                            imgpicture imgpicture = new imgpicture(this.Myapp, i);
                            Point      point      = new Point(0, imagesizexytype.y + imagesizexytype.height);
                            imgpicture.Location = point;
                            imgpicture.Tag      = point;
                            imgpicture.Width    = this.panel1.Width - 24;
                            imgpicture.ViewPic(Color.White, Color.Black);
                            this.panel1.Controls.Add(imgpicture);
                            imgpicture.Visible = true;
                            imgpicture.Focus();
                            imgpicture.img_MouseDown   += new EventHandler(this.buttonimg_MouseDown);
                            imgpicture.img_DoubleClick += new EventHandler(this.buttonimg_DoubleClick);
                            imgpicture.img_Keydown     += new KeyEventHandler(this.buttonimg_KeyDown);
                            imgpicture.ContextMenuStrip = this.contextMenuStrip1;
                            imagesizexytype.x           = point.X;
                            imagesizexytype.y           = point.Y;
                            imagesizexytype.width       = imgpicture.Width;
                            imagesizexytype.height      = imgpicture.Height;
                            this.imgpics.Add(imgpicture);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageOpen.Show(ex.Message);
                }
                this.label1.Text = this.Myapp.images.Count.ToString();
            }
        }
Beispiel #2
0
 private void buttonimg_MouseDown(object sender, EventArgs e)
 {
     try
     {
         imgpicture imgpicture = (imgpicture)sender;
         if (this.dimgpic != null)
         {
             this.dimgpic.ViewPic(this.panel1.BackColor, Color.Black);
         }
         this.dimgpic = imgpicture;
         this.dimgpic.ViewPic(Color.Blue, Color.White);
         if (this.picselect != null)
         {
             this.picselect(this.dimgpic.xuhao, null);
         }
         imgpicture.Focus();
     }
     catch (Exception ex)
     {
         MessageOpen.Show(ex.Message);
     }
 }
Beispiel #3
0
        private void buttonimg_DoubleClick(object sender, EventArgs e)
        {
            imgpicture imgpicture = (imgpicture)sender;

            new picview(this.Myapp, imgpicture.xuhao).ShowDialog();
        }