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

# GetBitmap Method of the Image Object

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

This method returns a part of the image as a top-down DIB (Device-Independent Bitmap). The palette, where 0 is the black color, is used for gray and black-and-white images.

The method returns the DIB as the [Handle](/fine-reader/engine/api-reference/supplementary-objects-and-methods/handle) object. This object manages memory allocation and releases resources when they are no longer in use.

## Syntax

### C++

```cpp theme={null}
HRESULT GetBitmap(
  IImageModification* Modification,
  IHandle**           Result
);
```

### C\#

```csharp theme={null}
IHandle GetBitmap( IImageModification Modification );
```

### Visual Basic .NET

```vb theme={null}
Function GetBitmap(Modification As IImageModification) As IHandle
```

## Parameters

Modification

\[in] This parameter of type [ImageModification](/fine-reader/engine/api-reference/image-related-objects/imagemodification) defines modifications that are performed upon image. It may include clipping rectangles, in which case only specified parts of the image are passed, stretch ratio, painting rectangles for filling up parts of the image with color and so on. This parameter may be 0, and in this case no modifications will be performed upon the image page and it will be passed "as is."

Result

\[out, retval] A pointer to IHandle\* pointer variable that receives interface pointer of the resulting [Handle](/fine-reader/engine/api-reference/supplementary-objects-and-methods/handle) object representing the handle to the associated bitmap.

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

## Samples

<Accordion title="C# code">
  ```csharp theme={null}
  FREngine.IEngine engine;
  FREngine.IFRDocument frdoc;
  // We presume that the document have been created and images have been added to it
  // Get bitmap handle of a color image plane of a document page
  FREngine.IFRPage page = frDoc.Pages[0];
  FREngine.IImageDocument imageDoc = page.ImageDocument;
  FREngine.IImage image = imageDoc.ColorImage;
  FREngine.IHandle hBitmap = image.GetBitmap( null );
  // Work with the bitmap
  System.Drawing.Image preprocessedImage = System.Drawing.Image.FromHbitmap( hBitmap.Handle );
  ...
  Gdi32.DeleteObject( hBitmap );
  ```
</Accordion>

The method is used in the following Windows demo tools: [Engine Predefined Processing Profiles](/fine-reader/engine/guided-tour/samples#engine_predefined_processing_profiles).

## See also

[ImageModification](/fine-reader/engine/api-reference/image-related-objects/imagemodification)

[IImage::EstimateBitmapSize](/fine-reader/engine/api-reference/image-related-objects/image/estimatebitmapsize-method)
