# BinaryImageUnit

The `BinaryImageUnit` class represents a unit that contains a binary image. It inherits from the `IntermediateResultUnit` class and stores binary image data.

## Definition

*Namespace:* Dynamsoft.Core.intermediate_results


```csharp
class BinaryImageUnit : IntermediateResultUnit 
```

## Methods

| Method               | Description |
|----------------------|-------------|
| [`GetImageData`](#getimagedata) | Gets the binary image data. |
| [`SetImageData`](#setimagedata) | Sets the binary image data. |

### Inherited Methods

Checkout inherited methods from [IntermediateResultUnit](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/core/intermediate-results/intermediate-result-unit.md) for more details.

### GetImageData

Gets the binary image data.

```csharp
ImageData GetImageData()
```

**Return value**

Returns the `ImageData` object containing the binary image data.

**See Also**

[ImageData](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/core/basic-classes/image-data.md)

### SetImageData

Sets the binary image data.

```csharp
int SetImageData(ImageData imgData)
```

**Parameters**

`[in] imgData` The image data to set.

**Return value**

Returns 0 if succeeds, nonzero otherwise.

**See Also**

[ImageData](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/core/basic-classes/image-data.md)
