예제 #1
0
 /// <summary>
 /// When called without a fileName,
 /// we provide a SaveFileDialog, then pass along to the version that takes a fileName
 /// </summary>
 private void SaveImageFile()
 {
     using (var dlg = new SaveFileDialog())
     {
         dlg.Filter = WinDemoHelperMethods.CreateDialogFilter(false);
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             // slight change from the video...
             SaveImageFile(dlg.FileName);
             _currentFile = dlg.FileName;
             UpdateStatusBar();
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainForm"/> class.
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
            LoadAnnotationToolbarImages();
            EnableDisableMenuAndToolbarItems();
            WinDemoHelperMethods.PopulateDecoders(RegisteredDecoders.Decoders);

            annotationViewer.SelectedIndexChanged          += AnnotationViewerSelectedIndexChanged;
            annotationViewer.Annotations.SelectionChanged  += AnnotationViewer_Annotations_SelectionChanged;
            annotationViewer.Annotations.Rotated           += AnnotationViewer_AnnotationRotated;
            annotationViewer.Annotations.Resized           += AnnotationViewer_AnnotationResized;
            annotationViewer.Annotations.Moved             += AnnotationViewer_AnnotationMoved;
            annotationViewer.Annotations.AnnotationCreated += AnnotationViewer_AnnotationCreated;

            annotationViewer.SelectFirstPageOnOpen      = true;
            annotationViewer.Annotations.ClipToDocument = true;
        }
예제 #3
0
        private void OpenImageFile()
        {
            using (var dlg = new OpenFileDialog())
            {
                dlg.Filter = WinDemoHelperMethods.CreateDialogFilter(true);
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    annotationViewer.Open(dlg.FileName, -1);
                    _currentFile = dlg.FileName;
                }
            }

            if (annotationViewer.Count > 0)
            {
                UpdateStatusBar();
            }

            EnableDisableMenuAndToolbarItems();
        }