VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.Undo Namespace / ImageProcessingUndoMonitor Class
Members Example



In This Topic
    ImageProcessingUndoMonitor Class
    In This Topic
    Undo monitor that monitors the Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase object and adds undo action to an undo manager if Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase changed an image.
    Object Model
    ImageProcessingUndoMonitor ClassIDataStorage InterfaceUndoManager Class
    Syntax
    'Declaration
     
    Public Class ImageProcessingUndoMonitor 
       Inherits UndoMonitor
    public class ImageProcessingUndoMonitor : UndoMonitor 
    public __gc class ImageProcessingUndoMonitor : public UndoMonitor 
    public ref class ImageProcessingUndoMonitor : public UndoMonitor 
    Example
    This example shows how to monitor changes in images and save the undo images on disk.
    ''' <summary>
    ''' Creates the undo monitor that stores undo-images on disk.
    ''' </summary>
    ''' <param name="undoManager">The undo manager.</param>
    ''' <param name="processingCommand">The processing command.</param>
    ''' <param name="storagePath">The storage path.</param>
    Public Shared Function CreateUndoMonitorForStoringImagesOnDisk(undoManager As Vintasoft.Imaging.Undo.UndoManager, processingCommand As Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase, storagePath As String) As Vintasoft.Imaging.Undo.ImageProcessingUndoMonitor
    	' create the undo monitor for processing command
    	Dim undoMonitor As New Vintasoft.Imaging.Undo.ImageProcessingUndoMonitor(undoManager, processingCommand)
                
    	' create the encoder, which will encode the images
    	Dim compressor As Vintasoft.Imaging.Codecs.Encoders.EncoderBase = New Vintasoft.Imaging.Codecs.Encoders.PngEncoder()
    	' create a data storage for storing images on disk
    	Dim dataStorageOnDisk As New Vintasoft.Data.CompressedImageStorageOnDisk(storagePath, compressor)
                
    	' specify that the undo monitor must store undo-images on disk
    	undoMonitor.DataStorage = dataStorageOnDisk
                
    	' returns the monitor for processing command
    	Return undoMonitor
    End Function
    /// <summary>
    /// Creates the undo monitor that stores undo-images on disk.
    /// </summary>
    /// <param name="undoManager">The undo manager.</param>
    /// <param name="processingCommand">The processing command.</param>
    /// <param name="storagePath">The storage path.</param>
    public static Vintasoft.Imaging.Undo.ImageProcessingUndoMonitor CreateUndoMonitorForStoringImagesOnDisk(
        Vintasoft.Imaging.Undo.UndoManager undoManager,
        Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase processingCommand,
        string storagePath)
    {
        // create the undo monitor for processing command
        Vintasoft.Imaging.Undo.ImageProcessingUndoMonitor undoMonitor =
            new Vintasoft.Imaging.Undo.ImageProcessingUndoMonitor(undoManager, processingCommand);
                
        // create the encoder, which will encode the images
        Vintasoft.Imaging.Codecs.Encoders.EncoderBase compressor =
            new Vintasoft.Imaging.Codecs.Encoders.PngEncoder();
        // create a data storage for storing images on disk
        Vintasoft.Data.CompressedImageStorageOnDisk dataStorageOnDisk =
            new Vintasoft.Data.CompressedImageStorageOnDisk(storagePath, compressor);
                
        // specify that the undo monitor must store undo-images on disk
        undoMonitor.DataStorage = dataStorageOnDisk;
                
        // returns the monitor for processing command
        return undoMonitor;
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.Undo.UndoMonitor
          Vintasoft.Imaging.Undo.ImageProcessingUndoMonitor

    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also