VintaSoft Imaging .NET SDK 14.1: Документация для .NET разработчика
Vintasoft.Imaging.Pdf.UI Namespace / PdfImageExtractorTool Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
    Класс PdfImageExtractorTool
    Визуальный инструмент, позволяющий выбирать и извлекать изображения на PDF странице.
    Объектная модель
    ContentImage ContentImage IObjectClipboard CopyItemUIAction DeselectAllItemsUIAction PdfPage ImageViewer PdfImageExtractorTool
    Синтаксис
    'Declaration
    
    Public Class PdfImageExtractorTool
       Inherits PdfVisualTool
       Implements ISupportUIActions
    
    
     
    Пример

    Вот C#/VB.NET код, который демонстрирует, как выделить выделенное изображение в PDF документе, загруженном в программу просмотра изображений.

    Public Partial Class FormWithPdfImageExtractorTool
        Inherits System.Windows.Forms.Form
        '...
        Private _imageViewer As Vintasoft.Imaging.UI.ImageViewer
        Private _imageExtractorTool As Vintasoft.Imaging.Pdf.UI.PdfImageExtractorTool
        '...
        Public Sub New()
            '...
            ' create an instance of the PdfImageExtractorTool
            _imageExtractorTool = New Vintasoft.Imaging.Pdf.UI.PdfImageExtractorTool()
    
            ' set a pen and brush for image selection
            _imageExtractorTool.SelectionBrush = New System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(32, System.Drawing.Color.Blue))
            _imageExtractorTool.SelectionPen = System.Drawing.Pens.Red
    
            ' subscribe to image extractor events
            AddHandler _imageExtractorTool.ImageMouseEnter, New System.EventHandler(Of Vintasoft.Imaging.Pdf.UI.PdfImageExtractorEventArgs)(AddressOf _pdfImageExtractorTool_ImageMouseEnter)
            AddHandler _imageExtractorTool.ImageMouseLeave, New System.EventHandler(Of Vintasoft.Imaging.Pdf.UI.PdfImageExtractorEventArgs)(AddressOf _pdfImageExtractorTool_ImageMouseLeave)
    
            ' set the image extractor tool as current tool
            _imageViewer.VisualTool = _imageExtractorTool
        End Sub
    
        ' Occurs when the mouse pointer enters the image on PDF page.
        Private Sub _pdfImageExtractorTool_ImageMouseEnter(sender As Object, e As Vintasoft.Imaging.Pdf.UI.PdfImageExtractorEventArgs)
            ' set the focused image as selected image
            _imageExtractorTool.SelectedImage = e.ContentImage
        End Sub
    
        ' Occurs when the mouse pointer leaves the image on PDF page.
        Private Sub _pdfImageExtractorTool_ImageMouseLeave(sender As Object, e As Vintasoft.Imaging.Pdf.UI.PdfImageExtractorEventArgs)
            ' remove selected image from image extractor tool
            _imageExtractorTool.SelectedImage = Nothing
        End Sub
    End Class
    
    
    public partial class FormWithPdfImageExtractorTool : System.Windows.Forms.Form
    {
        //...
        Vintasoft.Imaging.UI.ImageViewer _imageViewer;
        Vintasoft.Imaging.Pdf.UI.PdfImageExtractorTool _imageExtractorTool;
        //...
        public FormWithPdfImageExtractorTool()
        {
            //...
            // create an instance of the PdfImageExtractorTool
            _imageExtractorTool = new Vintasoft.Imaging.Pdf.UI.PdfImageExtractorTool();
    
            // set a pen and brush for image selection
            _imageExtractorTool.SelectionBrush = 
                new System.Drawing.SolidBrush(
                    System.Drawing.Color.FromArgb(32, System.Drawing.Color.Blue));
            _imageExtractorTool.SelectionPen = System.Drawing.Pens.Red;
    
            // subscribe to image extractor events
            _imageExtractorTool.ImageMouseEnter += 
                new System.EventHandler<Vintasoft.Imaging.Pdf.UI.PdfImageExtractorEventArgs>(_pdfImageExtractorTool_ImageMouseEnter);
            _imageExtractorTool.ImageMouseLeave += 
                new System.EventHandler<Vintasoft.Imaging.Pdf.UI.PdfImageExtractorEventArgs>(_pdfImageExtractorTool_ImageMouseLeave);
    
            // set the image extractor tool as current tool
            _imageViewer.VisualTool = _imageExtractorTool;
        }
    
        // Occurs when the mouse pointer enters the image on PDF page.
        void _pdfImageExtractorTool_ImageMouseEnter(object sender, Vintasoft.Imaging.Pdf.UI.PdfImageExtractorEventArgs e)
        {
            // set the focused image as selected image
            _imageExtractorTool.SelectedImage = e.ContentImage;
        }
    
        // Occurs when the mouse pointer leaves the image on PDF page.
        void _pdfImageExtractorTool_ImageMouseLeave(object sender, Vintasoft.Imaging.Pdf.UI.PdfImageExtractorEventArgs e)
        {
            // remove selected image from image extractor tool
            _imageExtractorTool.SelectedImage = null;
        }
    }
    
    

    Иерархия наследования

    System.Object
       Vintasoft.Imaging.UI.VisualTools.VisualTool
          Vintasoft.Imaging.Pdf.UI.PdfVisualTool
             Vintasoft.Imaging.Pdf.UI.PdfImageExtractorTool

    Требования

    Целевые платформы: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также