> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenBitmapBits Method of the Engine Object

<Warning>
  This method is implemented in FRE for Windows.
</Warning>

This method opens the specified [bitmap data](/fine-reader/engine/api-reference/enumerations/bitmapbitsformatenum) 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).

## Syntax

### C++

```cpp theme={null}
HRESULT OpenBitmapBits(
  BitmapBitsFormatEnum Format,
  int                  Width,
  int                  Height,
  int                  ByteWidth,
  int                  XResolution,
  int                  YResolution,
  __int64              RawDataPtr,
  IPrepareImageMode*   PrepareMode,
  IImageDocument**     Result
);
```

### C\#

```csharp theme={null}
IImageDocument OpenBitmapBits(
  BitmapBitsFormatEnum Format,
  int                  Width,
  int                  Height,
  int                  ByteWidth,
  int                  XResolution,
  int                  YResolution,
  Int64                RawDataPtr,
  IPrepareImageMode    PrepareMode
);
```

### Visual Basic .NET

```vb theme={null}
Function OpenBitmapBits( _
  Format As BitmapBitsFormatEnum, _
  Width As Integer, _
  Height As Integer, _
  ByteWidth As Integer, _
  XResolution As Integer, _
  YResolution As Integer, _
  RawDataPtr As Int64, _
  [PrepareMode As IPrepareImageMode = Nothing] _
) As IImageDocument
```

## Parameters

Format

\[in] This parameter of the [BitmapBitsFormatEnum](/fine-reader/engine/api-reference/enumerations/bitmapbitsformatenum) type describes the format of the bitmap data to be opened.

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 (padding included). 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](/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties). See the description of the [BitmapBitsFormatEnum](/fine-reader/engine/api-reference/enumerations/bitmapbitsformatenum) constants for details on the data format.

PrepareMode

\[in] Refers to the [PrepareImageMode](/fine-reader/engine/api-reference/image-related-objects/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](/fine-reader/engine/guided-tour/advanced-techniques/working-with-profiles) has been loaded, the parameters set by this profile are used.

Result

\[out, retval] A pointer to IImageDocument\* pointer variable that receives the interface pointer of the resulting [ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument) object.

## Return values

Windows: This method has no specific return values. It returns the [standard return values of ABBYY FineReader Engine functions](/fine-reader/engine/api-reference/return-codes).

Linux and macOS: This method returns E\_NOTIMPL.

## Remarks

This method does not work if the Engine is loaded as an out-of-process server in Linux or if the object is created using the [OutprocLoader](/fine-reader/engine/api-reference/engine-loaders/outprocloader) object in Windows.

## See also

[Engine](/fine-reader/engine/api-reference/engine-object-iengine-interface)

[BitmapBitsFormatEnum](/fine-reader/engine/api-reference/enumerations/bitmapbitsformatenum)

[Working with Profiles](/fine-reader/engine/guided-tour/advanced-techniques/working-with-profiles)
