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

# SetImageData Method of the TrainingImage Object

This method sets the training image data from the region of an image document.

## Syntax

### C++

```cpp theme={null}
HRESULT SetImageData(
  IImageDocument* ImageDocument,
  IRegion*        CutRegion
);
```

### C\#

```csharp theme={null}
void SetImageData(
  IImageDocument ImageDocument,
  IRegion        CutRegion
);
```

### Visual Basic .NET

```vb theme={null}
Sub SetImageData( _
  ImageDocument As IImageDocument, _
  CutRegion As IRegion _
)
```

## Parameters

ImageDocument

\[in] Refers to the [ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument) object corresponding to the image that is to be used for training.

CutRegion

\[in] Refers to the [Region](/fine-reader/engine/api-reference/supplementary-objects-and-methods/region) object that specifies the area on image that is to be used for training. It should be set in coordinates of the deskewed black-and-white plane of the [ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument).

## Return values

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

## See also

[TrainingImage](/fine-reader/engine/api-reference/image-related-objects/trainingimage)
