Saves one or more pages of a RasterImage to a file in any of the supported compressed or uncompressed formats asynchronously.
public void SaveAsync(
RasterImage image,
string fileName,
RasterImageFormat format,
int bitsPerPixel,
int firstPage,
int lastPage,
int firstSavePageNumber,
CodecsSavePageMode pageMode,
object userState
)
public:
void SaveAsync(
RasterImage^ image,
String^ fileName,
RasterImageFormat^ format,
int bitsPerPixel,
int firstPage,
int lastPage,
int firstSavePageNumber,
CodecsSavePageMode^ pageMode,
Object^ userState
)
- (void)saveAsync:(LTRasterImage *)image
file:(NSString *)file
format:(LTRasterImageFormat)format
bitsPerPixel:(NSInteger)bitsPerPixel
firstPage:(NSInteger)firstPage
lastPage:(NSInteger)lastPage
firstSavePageNumber:(NSInteger)firstSavePageNumber
pageMode:(LTCodecsSavePageMode)pageMode
completion:(void (^)(NSError * __nullable error))completion
def SaveAsync(self,image,fileName,format,bitsPerPixel,firstPage,lastPage,firstSavePageNumber,pageMode,userState):
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 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 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.
firstPage
1-based index of the first page in image to save.
lastPage
1-based index of the last page in image to save. Pass -1 to save from
firstPage to the last page in image.
firstSavePageNumber
1-based index of the first output page. If the output file already exists, then this
parameter lets you control which pages to overwrite and/or where to append the new pages.
pageMode
Determines how to handle the page when saving to multipage formats. This can be one of the following:
Value |
Meaning |
---|---|
Append the new page(s) to the end of the file. If the file does not exist, this option will create the file and add the pages to it. firstSavePageNumber is not used. |
|
Insert the new page(s) at the index specified by firstSavePageNumber. |
|
Replace the page(s) starting at the index specified by firstSavePageNumber. |
|
Overwrite the page(s) starting at the index specified by firstSavePageNumber. |
userState
A user-defined object that is passed to the method invoked when the asynchronous operation completes.
NOTE: This topic is part of RasterCodecs
Async support using the .NET System.ComponentMode.AsyncOperation
model. For .NET async/await
,
use Task<bool> SaveAsync(RasterImage image, ILeadStream stream, RasterImageFormat format, int bitsPerPixel, int firstPage, int lastPage, int firstSaveNumber, CodecsSavePageMode pageMode).
The SaveAsyncCompleted event will occur when the RasterCodecs finishes saving the image.
For general information on saving images using RasterCodecs, refer to Save.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document