Esempio n. 1
0
        private void sprite_MouseClick(object sender, MouseEventArgs e)
        {
            ImagenBox sprite = (ImagenBox)sender;

            CurrentFilePath = sprite.Tag.ToString();
            string filesearch = GetFileNameFromString(sprite.Tag.ToString());

            CurrentFile = filesearch;
            Debug.WriteLine("sprite nombre -> " + sprite.Tag.ToString());
            toolStripMenuItemPlay.Enabled = true;
            if (e.Button == MouseButtons.Right)
            {
                Debug.Write("sprite_mouseclick_right");
                Debug.WriteLine(", sprite a eliminar con nombre : " + sprite.Tag.ToString());
                //propertyGrid1.SelectedObject = null;
                //tabControl1.SelectedTab.Controls[0].Controls.Remove(sprite); //todo revisar.
            }

            if (e.Button == MouseButtons.Left)
            {
                Debug.Write("sprite_mouseclick_left");
                Debug.WriteLine(", name = " + sprite.Tag.ToString());
                toolStripStatusLabel1.Text = sprite.Tag.ToString();
                if (Form.ModifierKeys == Keys.Control)
                {
                    //abrir formulario con la imagen.
                    FGif fgif = new FGif();
                    Size size = new Size(sprite.Imagen.Width, sprite.Imagen.Height);
                    fgif.Size        = size;
                    fgif.ImageToView = sprite.Imagen;
                    fgif.Tag         = sprite.Tag;
                    fgif.Show();
                    Debug.WriteLine("sprite_mouseClick_left + Key-Control: presed");
                }

                if (Form.ModifierKeys == Keys.Alt)
                {
                    if (Path.GetExtension(filesearch).Equals(".gif"))
                    {
                        MessageBox.Show("OOOfff");
                        return;
                    }

                    Search control = new Search()
                    {
                        SearchString = filesearch,
                        AutoProcess  = true
                    };
                    control.Start();
                    Debug.WriteLine("sprite_mouseClick_left + Key-Alt: process");
                }

                if (Form.ModifierKeys == Keys.Shift)
                {
                    tabControl1.SelectedTab.Controls[0].Controls.Remove(sprite);
                    Debug.WriteLine("delete picture con Key -> Shift:");
                }
            }
        }
Esempio n. 2
0
        void ToolStripGifClick(object sender, EventArgs e)
        {
            Image sprite = Image.FromFile(CurrentFilePath);
            FGif  fgif   = new FGif();
            Size  size   = new Size(sprite.Width, sprite.Height);

            fgif.Size        = size;
            fgif.ImageToView = sprite;
            fgif.Tag         = CurrentFilePath;    // sprite.Tag;
            fgif.Show();
        }