WriteToFile Method of the Image Object

This method saves a copy of the current image plane into an image file in the specified format.

Important! You cannot use this method to save an image-only PDF file. It can be done by using one of the export methods, for example, Export method of the corresponding FRPage object with IPDFExportParams::TextExportMode set to PEM_ImageOnly.

Syntax

C++

HRESULT WriteToFile(
  BSTR                FileName,
  ImageFileFormatEnum Format,
  IImageModification* Modification,
  IUnknown*           ExtendedParams
);
    

C#

void WriteToFile(
  string              FileName,
  ImageFileFormatEnum Format,
  IImageModification   Modification,
  object              ExtendedParams
);
    

Visual Basic .NET

Sub WriteToFile( _
  FileName As String, _
  Format As ImageFileFormatEnum, _
  [Modification As IImageModification = Nothing], _
  [ExtendedParams As Object = Nothing] _
)
    

Parameters

FileName
[in] This parameter contains the full path to the image file where the image is to be saved. For example, "C:\MyPic.bmp". If a file in this path already exists, it is overwritten without prompt.
Format
[in] A variable of the ImageFileFormatEnum type that specifies the format of the output file. Not all formats defined by this enumeration are supported for writing.
Modification
[in] This parameter of the ImageModification type defines modifications that are performed upon image before writing it into file. This parameter is optional and may be 0, in which case no modifications are performed upon image.
ExtendedParams
[in] This variable may refer to a JpegExtendedParams, PngExtendedParams, or TiffExtendedParams object that defines parameters for saving the image to JPEG, PNG, or TIFF format, respectively. This parameter is optional and may be 0. In this case, the image is saved with lossless JPEG 2000 compression, in case of JPEG, without transparency, in case of PNG, or with default quality, in case of TIFF.

Return values

This method has no specific return values. It returns the standard return values of ABBYY FineReader Engine functions.

See also

Working with Images

ImageFileFormatEnum

ImageModification

24.03.2023 8:51:52

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.