VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.Annotation.Wpf.Print Namespace / WpfAnnotatedImagePrintManager Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
    WpfAnnotatedImagePrintManager Class
    In This Topic
    Provides functionality for printing ImageCollection with annotations. Also class allows to use the WpfThumbnailViewer for print preview.
    Object Model
    ImageCollection WpfThumbnailViewer ColorManagementDecodeSettings ColorManagementDecodeSettings ProcessingCommandBase Resolution Resolution WpfAnnotatedImagePrintManager
    Syntax
    'Declaration
    
    Public Class WpfAnnotatedImagePrintManager
       Inherits Vintasoft.Imaging.Wpf.Print.WpfImagePrintManager
    
    
    public class WpfAnnotatedImagePrintManager : Vintasoft.Imaging.Wpf.Print.WpfImagePrintManager
    
    
    public __gc class WpfAnnotatedImagePrintManager : public Vintasoft.Imaging.Wpf.Print.WpfImagePrintManager*
    
    
    public ref class WpfAnnotatedImagePrintManager : public Vintasoft.Imaging.Wpf.Print.WpfImagePrintManager^
    
    
    Example

    This C#/VB.NET code shows how to print a image collection with annotations on a default printer, each image of the image collection will be printed in BestFit mode:

    
    ''' <summary>
    ''' Prints the images on default printer.
    ''' </summary>
    ''' <param name="images">The images.</param>
    Public Sub PrintImagesOnDefaultPrinter(images As Vintasoft.Imaging.ImageCollection)
        ' create data controller
        Dim dataController As New Vintasoft.Imaging.Annotation.AnnotationDataController(images)
        ' create print manager
        Dim imagePrintManager As New Vintasoft.Imaging.Annotation.Wpf.Print.WpfAnnotatedImagePrintManager(dataController)
        ' specify that each image must be resized to fit within the page margins,
        ' image proportions is not changed
        imagePrintManager.PrintScaleMode = Vintasoft.Imaging.Print.PrintScaleMode.BestFit
    
        ' subscribe to the PrintingProgress event
        AddHandler imagePrintManager.PrintingProgress, New System.EventHandler(Of Vintasoft.Imaging.ProgressEventArgs)(AddressOf imagePrintManager_PrintingProgress)
    
        ' start print
        imagePrintManager.Print("Print task title")
    End Sub
    
    ''' <summary>
    ''' Printing is in progress.
    ''' </summary>
    Private Sub imagePrintManager_PrintingProgress(sender As Object, e As Vintasoft.Imaging.ProgressEventArgs)
        ' if printing is started
        If e.Progress = 0 Then
            System.Console.Write("Printing: ")
        End If
    
        ' write the printing progress
        System.Console.Write(String.Format("{0} ", e.Progress))
    
        ' if printing is finished
        If e.Progress = 100 Then
            Dim imagePrintManager As Vintasoft.Imaging.Annotation.Wpf.Print.WpfAnnotatedImagePrintManager = DirectCast(sender, Vintasoft.Imaging.Annotation.Wpf.Print.WpfAnnotatedImagePrintManager)
            ' unsubscribe from the PrintingProgress event
            RemoveHandler imagePrintManager.PrintingProgress, New System.EventHandler(Of Vintasoft.Imaging.ProgressEventArgs)(AddressOf imagePrintManager_PrintingProgress)
        End If
    End Sub
    
    
    
    /// <summary>
    /// Prints the images on default printer.
    /// </summary>
    /// <param name="images">The images.</param>
    public void PrintImagesOnDefaultPrinter(Vintasoft.Imaging.ImageCollection images)
    {
        // create data controller
        Vintasoft.Imaging.Annotation.AnnotationDataController dataController =
            new Vintasoft.Imaging.Annotation.AnnotationDataController(images);
        // create print manager
        Vintasoft.Imaging.Annotation.Wpf.Print.WpfAnnotatedImagePrintManager imagePrintManager =
            new Vintasoft.Imaging.Annotation.Wpf.Print.WpfAnnotatedImagePrintManager(dataController);
        // specify that each image must be resized to fit within the page margins,
        // image proportions is not changed
        imagePrintManager.PrintScaleMode = Vintasoft.Imaging.Print.PrintScaleMode.BestFit;
    
        // subscribe to the PrintingProgress event
        imagePrintManager.PrintingProgress +=
            new System.EventHandler<Vintasoft.Imaging.ProgressEventArgs>(imagePrintManager_PrintingProgress);
    
        // start print
        imagePrintManager.Print("Print task title");
    }
    
    /// <summary>
    /// Printing is in progress.
    /// </summary>
    private void imagePrintManager_PrintingProgress(object sender, Vintasoft.Imaging.ProgressEventArgs e)
    {
        // if printing is started
        if (e.Progress == 0)
            System.Console.Write("Printing: ");
    
        // write the printing progress
        System.Console.Write(string.Format("{0} ", e.Progress));
    
        // if printing is finished
        if (e.Progress == 100)
        {
            Vintasoft.Imaging.Annotation.Wpf.Print.WpfAnnotatedImagePrintManager imagePrintManager =
                (Vintasoft.Imaging.Annotation.Wpf.Print.WpfAnnotatedImagePrintManager)sender;
            // unsubscribe from the PrintingProgress event
            imagePrintManager.PrintingProgress -=
                new System.EventHandler<Vintasoft.Imaging.ProgressEventArgs>(imagePrintManager_PrintingProgress);
        }
    }
    
    

    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.Wpf.Print.WpfImagePrintManager
          Vintasoft.Imaging.Annotation.Wpf.Print.WpfAnnotatedImagePrintManager

    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