示例#1
0
        private void _menuItemAnimationCreate_Click(object sender, EventArgs e)
        {
            CreateAnimationDialog createAnimationDialog = new CreateAnimationDialog();

            createAnimationDialog.Owner = this;
            if (createAnimationDialog.ShowDialog() == DialogResult.OK)
            {
                createAnimationDialog.Image.AnimationGlobalLoop = 1000;
                createAnimationDialog.Image.AnimationDelay      = 500;
                ImageInformation info  = new ImageInformation(createAnimationDialog.Image);
                ViewerForm       child = new ViewerForm();
                child.MdiParent = this;
                child.Initialize(info, _paintProperties, _animateRegions, true, _useDpi, _animationMode);
                child.Show();
            }
        }
示例#2
0
        private void _menuItemPageDeleteCurrentPage_Click(object sender, EventArgs e)
        {
            try
            {
                ViewerForm activeForm = ActiveViewerForm;

                activeForm.Image.RemovePageAt(activeForm.Image.Page);
            }
            catch (Exception ex)
            {
                Messager.ShowError(this, ex);
            }
            finally
            {
                UpdateControls();
            }
        }
示例#3
0
        private void _menuItemPage_Click(object sender, EventArgs e)
        {
            try
            {
                ViewerForm  activeForm = ActiveViewerForm;
                RasterColor background = activeForm.Image.AnimationBackground;

                if (activeForm.Viewer.Image.HasRegion)
                {
                    activeForm.Viewer.Image.MakeRegionEmpty();
                }

                if (sender == _menuItemPageFirst)
                {
                    activeForm.Image.Page = 1;
                }
                else if (sender == _menuItemPagePrevious)
                {
                    activeForm.Image.Page--;
                }
                else if (sender == _menuItemPageNext)
                {
                    activeForm.Image.Page++;
                }
                else if (sender == _menuItemPageLast)
                {
                    activeForm.Image.Page = activeForm.Image.PageCount;
                }

                activeForm.Image.AnimationBackground = background;
            }
            catch (Exception ex)
            {
                Messager.ShowError(this, ex);
            }
            finally
            {
                UpdateControls();
            }
        }
示例#4
0
 private void _menuItemEditPaste_Click(object sender, EventArgs e)
 {
     try
     {
         using (WaitCursor wait = new WaitCursor())
         {
             RasterImage image = RasterClipboard.Paste(this.Handle);
             if (image != null)
             {
                 ViewerForm activeForm = ActiveViewerForm;
                 NewImage(new ImageInformation(image));
             }
         }
     }
     catch (Exception ex)
     {
         Messager.ShowError(this, ex);
     }
     finally
     {
         UpdateControls();
     }
 }
示例#5
0
 public void LoadDropFiles(ViewerForm viewer, string[] files)
 {
     try
     {
         if (files != null)
         {
             for (int i = 0; i < files.Length; i++)
             {
                 try
                 {
                     RasterImage      image = _codecs.Load(files[i]);
                     ImageInformation info  = new ImageInformation(image, files[i]);
                     if (i == 0 && viewer != null)
                     {
                         viewer.Initialize(info, _paintProperties, _animateRegions, false, _useDpi, _animationMode);
                     }
                     else
                     {
                         NewImage(info);
                     }
                 }
                 catch (Exception ex)
                 {
                     Messager.ShowFileOpenError(this, files[i], ex);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Messager.ShowError(this, ex);
     }
     finally
     {
         UpdateControls();
     }
 }
示例#6
0
        private void MainForm_MdiChildActivate(object sender, EventArgs e)
        {
            ViewerForm activeForm = ActiveViewerForm;

            UpdateControls();
        }