VintaSoft Imaging .NET SDK 12.3: Documentation for .NET developer
Vintasoft.Imaging.Pdf.UI Namespace / PdfImageExtractorTool Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
    PdfImageExtractorTool Class
    In This Topic
    Visual tool that allows to select and extract images on PDF page.
    Object Model
    ContentImage ContentImage IObjectClipboard CopyItemUIAction DeselectAllItemsUIAction PdfPage ImageViewer PdfImageExtractorTool
    Syntax
    'Declaration
    
    Public Class PdfImageExtractorTool
       Inherits PdfVisualTool
       Implements ISupportUIActions
    
    
    public class PdfImageExtractorTool : PdfVisualTool, ISupportUIActions
    
    
    public __gc class PdfImageExtractorTool : public PdfVisualTool*, ISupportUIActions
    
    
    public ref class PdfImageExtractorTool : public PdfVisualTool^, ISupportUIActions
    
    
    Example

    This C#/VB.NET code shows how to highlight focused image in PDF document loaded into image viewer.

    
    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;
        }
    }
    
    

    Inheritance Hierarchy

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

    Requirements

    Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also