←Select platform

SaveAsync(RasterImage,string,RasterImageFormat,int,object) Method

Summary

Saves a RasterImage to a file in any of the supported compressed or uncompressed formats asynchronously.

Syntax

C#
VB
Objective-C
C++
public void SaveAsync( 
   RasterImage image, 
   string fileName, 
   RasterImageFormat format, 
   int bitsPerPixel, 
   object userState 
) 
Public Sub SaveAsync( 
   ByVal image As RasterImage, 
   ByVal fileName As String, 
   ByVal format As RasterImageFormat, 
   ByVal bitsPerPixel As Integer, 
   ByVal userState As Object 
) 
public:  
   void SaveAsync( 
      RasterImage^ image, 
      String^ fileName, 
      RasterImageFormat^ format, 
      int bitsPerPixel, 
      Object^ userState 
   ) 
- (void)saveAsync:(LTRasterImage *)image 
file:(NSString *)file 
format:(LTRasterImageFormat)format 
bitsPerPixel:(NSInteger)bitsPerPixel 
completion:(void (^)(NSError * nullable error))completion 
 

Parameters

image

The RasterImage object that holds the image data.

fileName

A System.String containing the output file name.

format

The output file format. For valid values,

Summary of All Supported Image File Formats.

bitsPerPixel

Resulting file's pixel depth. Note that not all bits per pixel are

available to all file formats. For valid values, refer to Summary of All Supported Image File Formats. If

bitsPerPixel is 0, the image will be stored using the closest bits/pixel value supported by that format. For example, if a file format supports 1, 4, and 24 bits/pixel, and RasterImage.BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if RasterImage.BitsPerPixel is 2, the file will be stored as 4 bit.

userState

A user-defined object that is passed to the method invoked when the asynchronous operation completes.

Remarks

The SaveAsyncCompleted event will occur when the RasterCodecs finishes saving the image.

For general information on saving images using RasterCodecs, refer to Save.

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly