> ## 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.

# OpenDib Method of the Engine Object

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

This method opens the specified device-independent bitmap. DIB must be created using Windows API.

## Syntax

### C++

```cpp theme={null}
HRESULT OpenDib(
  __int64            DibHglobal,
  int                XResolution,
  int                YResolution,
  IPrepareImageMode* PrepareMode,
  IImageDocument**   Result
);
```

### C\#

```csharp theme={null}
IImageDocument OpenDib(
  Int64            DibHglobal,
  int              XResolution,
  int              YResolution,
  IPrepareImageMode PrepareMode
);
```

### Visual Basic .NET

```vb theme={null}
Function OpenDib( _
  DibHglobal As Int64, _
  XResolution As Integer, _
  YResolution As Integer, _
  [PrepareMode As IPrepareImageMode = Nothing] _
) As IImageDocument
```

## Parameters

DibHglobal

\[in] This variable contains the handle of the memory block (HGLOBAL) where the bitmap is saved. This handle should be available to the process that operates ABBYY FineReader Engine. The handle is passed as [\_\_int64](/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties).

XResolution

\[in] Specifies the horizontal resolution of the bitmap.

YResolution

\[in] Specifies the vertical resolution of the bitmap.

PrepareMode

\[in] This variable refers to the [PrepareImageMode](/fine-reader/engine/api-reference/image-related-objects/prepareimagemode) object that stores parameters for bitmap conversion in internal format. This parameter may be 0 in which case default parameters of the image preparation mode are 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 to 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.

## See also

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

[PrepareDib](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/preparedib-method)

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