PrepareBitmapBits Method of the Engine Object

This method creates a copy of the specified bitmap data in FineReader Engine internal image format and supports the following image formats:

  • 1-bit monochrome (each pixel is represented as 1 bit).
  • 8-bit gray (each pixel is represented as 8 bits).
  • 24-bit color (each 24 bits use 8 bits of each R, G, B component).

The output image obtained from this method may then be opened using the IEngine::LoadImageDoc method.

Syntax

C++

HRESULT PrepareBitmapBits(
  BitmapBitsFormatEnum Format,
  int                  Width,
  int                  Height,
  int                  ByteWidth,
  int                  XResolution,
  int                  YResolution,
  __int64              RawDataPtr,
  BSTR                 DestinationFolderName,
  IPrepareImageMode*   PrepareMode
);
    

C#

void PrepareBitmapBits(
  BitmapBitsFormatEnum Format,
  int                  Width,
  int                  Height,
  int                  ByteWidth,
  int                  XResolution,
  int                  YResolution,
  Int64                RawDataPtr,
  string               DestinationFolderName,
  IPrepareImageMode     PrepareMode
);
    

Visual Basic .NET

Sub PrepareBitmapBits( _
  Format As BitmapBitsFormatEnum, _
  Width As Integer, _
  Height As Integer, _
  ByteWidth As Integer_
  XResolution As Integer, _
  YResolution As Integer, _
  RawDataPtr As Int64, _
  DestinationFolderName As String, _
  [PrepareMode As IPrepareImageMode = Nothing] _
)
    

Parameters

Format
[in] This parameter of BitmapBitsFormatEnum type specifies the format of the bitmap data that is to be prepared.
Width
[in] Specifies the width of the bitmap in pixels. This parameter must not be 0.
Height
[in] Specifies the height of the bitmap in pixels. This parameter must not be 0.
ByteWidth
[in] Specifies the width of the line of bitmap in bytes. It should account for justification. This parameter must not be 0.
XResolution
[in] Specifies the horizontal resolution of the bitmap in dots per inch.
YResolution
[in] Specifies the vertical resolution of the bitmap in dots per inch.
RawDataPtr
[in] This parameter is treated as a handle to memory buffer containing bitmap data. The handle is passed as __int64. See the description of the BitmapBitsFormatEnum constants for details on the data format.
DestinationFolderName
[in] Specifies the full path to the folder, where the image in internal format should be saved. This folder must exist; otherwise, an error code is returned.
PrepareMode
[in] Refers to the PrepareImageMode object that defines the mode of image preparation. It may be 0, in which case default values for the PrepareImageMode properties will be used, or, if a profile has been loaded, the parameters set by this profile are used.

Return values

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

Remarks

  • If you need to delete the files with prepared images when they are no longer necessary, implement the procedure in your application. These files will not be automatically removed from the disk by ABBYY FineReader Engine.
  • This method does not work if the Engine object is created using the OutprocLoader object.

See also

Engine

OpenBitmapBits

LoadImageDoc

BitmapBitsFormatEnum

Working with Profiles

17.09.2024 15:14:40

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.