←Select platform

CodecsSaveAsyncCompletedEventArgs Class

Summary

Contains data for the RasterCodecs.SaveAsyncCompleted event.

Syntax
C#
C++/CLI
Java
Python
public class CodecsSaveAsyncCompletedEventArgs : CodecsAsyncCompletedEventArgs 
public ref class CodecsSaveAsyncCompletedEventArgs : CodecsAsyncCompletedEventArgs 
public class CodecsSaveAsyncCompletedEvent extends CodecsAsyncCompletedEvent 
class CodecsSaveAsyncCompletedEventArgs(CodecsAsyncCompletedEventArgs): 
Remarks

NOTE: This topic is part of RasterCodecs Async support using the .NET System.ComponentMode.AsyncOperation model. For .NET async/await support this type/member is not used. Instead, refer to RasterCodecs Async Operations.

The RasterCodecs class supports saving image files asynchronously using the SaveAsync(RasterImage,Uri,RasterImageFormat,int,int,int,object) methods. When calling any of these methods, the caller's thread will not be blocked and the method will return instantly.

When the RasterCodecs object finishes saving the image, the SaveAsyncCompleted event is fired to provide notification that the operation has been completed and whether any errors occurred.

The SaveAsyncCompleted event uses a data argument object of type CodecsSaveAsyncCompletedEventArgs. This class contains the following properties:

Property

Description

CodecsSaveAsyncCompletedEventArgs.Uri, CodecsSaveAsyncCompletedEventArgs.Stream and CodecsSaveAsyncCompletedEventArgs.FileName

Contains the URI, stream or filename passed to the method that initialized this asynchronous operation.

Only one of these properties can be a valid value (not a null reference) at any time. The property that contains a valid reference depends on which version overload of the SaveAsync(RasterImage,Uri,RasterImageFormat,int,int,int,object) method has been called.

For example, if SaveAsync(RasterImage image, Uri uri, RasterImageFormat format, int bitsPerPixel, object userState)
has been called, the Uri will contain the same URI passed to the method while Stream and FileName will both be null. If SaveAsync(RasterImage image, string fileName, RasterImageFormat format, int bitsPerPixel, object userState) has been called, the FileName will contain the same filename string value passed to the method while Uri and Stream will both be null, and so on.

CodecsSaveAsyncCompletedEventArgs.Image

Contains the original RasterImage object passed to the calling Save method.

System.ComponentModel.AsyncCompletedEventArgs.Error

Contains any errors that might have occurred during the asynchronous operation. You must check this value when the SaveAsyncCompleted event fires and make sure it does not contain a valid System.Exception object.

System.ComponentModel.AsyncCompletedEventArgs.Cancelled

Contains a value indicating whether an asynchronous operation has been cancelled, (for example, by calling CancelAsync when using SaveAsync with an URL).

Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.