ProgressEventHandler
ImageOptionsBase.ProgressEventHandler property
获取或设置进度事件处理程序。
public ProgressEventHandler ProgressEventHandler { get; set; }
适当的价值
进度事件处理程序。
例子
以下示例显示如何打印有关加载/导出操作的进度事件的信息。
[C#]
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);
}
// STDOUT 日志可能如下所示:
//初始化:1/4
//预处理:2/4
//处理:3/4
//完成:4/4
//导出事件初始化:1/4
//导出事件预处理:2/4
//导出事件处理:3/4
//导出事件RelativeProgress : 1/1
//相对进度:1/1
//导出事件完成:4/4
也可以看看
- delegate ProgressEventHandler
- class ImageOptionsBase
- 命名空间 Aspose.Imaging
- 部件 Aspose.Imaging