Exemplo n.º 1
0
        private void MenuOpenOnClick(object sender, EventArgs e)
        {
            if (_openFileDialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            var file       = _openFileDialog.FileName;
            var frameCount = RegisteredDecoders.GetImageInfo(file, 0).FrameCount;

            _totalPageLabel.Text = @"of " + frameCount;
            _thumbnailView.Items.Cancel();
            _thumbnailView.Items.Clear();

            // Create the Thumbnail objects and pass them into the ThumbnailView all at once.
            var thumbs = new Thumbnail[frameCount];

            for (var i = 0; i < frameCount; i++)
            {
                thumbs[i] = new Thumbnail(file, i, (i + 1).ToString(), "");
            }
            _thumbnailView.Items.AddRange(thumbs);

            //open the first full size page
            ViewPage(0);

            _extractedImages = false;
            _currentFile     = file;
            _workspaceViewer.Annotations.CurrentLayer.Items.Clear();
            _menuItemFind.Enabled = true;

            LoadPdfBookmarks(file);
        }
Exemplo n.º 2
0
        private Int32 FramCount(string ImagePath)
        {
            Int32 frmCount;

            try
            {
                frmCount = RegisteredDecoders.GetImageInfo(ImagePath).FrameCount;
                return(frmCount);
            }
            catch
            {
                return(-1);
            }
        }