VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.Pdf.UI Namespace / PdfImageExtractorTool Class
Members Example



In This Topic
    PdfImageExtractorTool Class
    In This Topic
    Visual tool that allows to select and extract images on PDF page.
    Object Model
    PdfImageExtractorTool ClassIObjectClipboard InterfaceContentImage ClassCopyItemUIAction ClassPdfPage ClassDeselectAllItemsUIAction ClassImageViewer ClassContentImage Class
    Syntax
    'Declaration
     
    Public Class PdfImageExtractorTool 
       Inherits PdfVisualTool
       Implements Vintasoft.Imaging.UIActions.ISupportUIActions 
    public class PdfImageExtractorTool : PdfVisualTool, Vintasoft.Imaging.UIActions.ISupportUIActions  
    public __gc class PdfImageExtractorTool : public PdfVisualTool, Vintasoft.Imaging.UIActions.ISupportUIActions  
    public ref class PdfImageExtractorTool : public PdfVisualTool, Vintasoft.Imaging.UIActions.ISupportUIActions  
    Example
    This example 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 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 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: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also