Class ProgressEventHandlerInfo

Class ProgressEventHandlerInfo

Namespace: Aspose.Imaging.ProgressManagement
Assembly: Aspose.Imaging.dll (25.7.0)

This class represents information about image load/save/export operations progress,that can be used in external application to show conversion progress to end user

public class ProgressEventHandlerInfo
   {
       public event EventHandler<ProgressEventArgs> OnProgressChanged;
       private double _progressValue = 0D;
       public double ProgressValue
       {
           get => _progressValue;
           set
           {
               if (_progressValue != value)
               {
                   _progressValue = value;
                   OnProgressChanged?.Invoke(this, new ProgressEventArgs(_progressValue));
               }
           }
       }
       public class ProgressEventArgs : EventArgs
       {
           private double _progressValue;
           public ProgressEventArgs(double progressValue) => _progressValue = progressValue;
           public double ProgressValue => _progressValue;
       }
   }

Inheritance

object ProgressEventHandlerInfo

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

The following example shows how to print information about progress events for load/export operations.

public void Test3460()
   {
      string dir = "c:\\aspose.imaging\\net\\issues\\3460";
      string fileName = System.IO.Path.Combine(dir, "big.png");
      using (var image = Aspose.Imaging.Image.Load(fileName, new Aspose.Imaging.LoadOptions { ProgressEventHandler = ProgressCallback }))
      {
         image.Save(fileName + ".psd",
            new Aspose.Imaging.ImageOptions.PsdOptions() { ProgressEventHandler = ExportProgressCallback });
      }
   }
   private void ProgressCallback(Aspose.Imaging.ProgressManagement.ProgressEventHandlerInfo info)
   {
      System.Console.WriteLine("{0} : {1}/{2}", info.EventType, info.Value, info.MaxValue);
   }
   private void ExportProgressCallback(Aspose.Imaging.ProgressManagement.ProgressEventHandlerInfo info)
   {
      System.Console.WriteLine("Export event {0} : {1}/{2}", info.EventType, info.Value, info.MaxValue);
   }

Properties

Description

Gets the description of the event

public string Description
   {
      get;
   }

Property Value

string

EventType

Gets the type of the event.

public event EventType EventType
   {
      get;
   }

Property Value

EventType

MaxValue

Gets the upper progress value limit.

public int MaxValue
   {
      get;
   }

Property Value

int

Value

Gets current progress value.

public int Value
   {
      get;
   }

Property Value

int

 English