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

# Transform Method of the ImageDocument Object

This method transforms the current [ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument). Among available transformations are inversion of colors, mirroring and rotation by 90, 180 and 270 degrees.

<Warning>
  All blocks must be removed from page layout before this method call. Call the [ILayoutBlocks::DeleteAll](/fine-reader/engine/visual-components-reference/supplementary-objects/spellwordcollection/deleteall-method) method for [ILayout::Blocks](/fine-reader/engine/api-reference/layout-related-objects/layout#blocks) and [ILayout::BlackSeparators](/fine-reader/engine/api-reference/layout-related-objects/layout#blackseparators) , and [ILayout::VisualBlocks](/fine-reader/engine/api-reference/layout-related-objects/layout#visualblocks) (Win) collections of the corresponding layout.
</Warning>

## Syntax

### C++

```cpp theme={null}
HRESULT Transform(
  RotationTypeEnum Rotation,
  VARIANT_BOOL     Mirror,
  VARIANT_BOOL     Invert
);
```

### C\#

```csharp theme={null}
void Transform(
  RotationTypeEnum Rotation,
  bool             Mirror,
  bool             Invert
);
```

### Visual Basic .NET

```vb theme={null}
Sub Transform( _
  Rotation As RotationTypeEnum, _
  Mirror As Boolean, _
  Invert As Boolean _
)
```

## Parameters

**Rotation**

\[in] This variable of the [RotationTypeEnum](/fine-reader/engine/api-reference/enumerations/rotationtypeenum) type defines the angle of rotation for the image.

**Mirror**

\[in] This parameter specifies whether the image should be mirrored around the vertical axis during transformation.

**Invert**

\[in] This parameter specifies if image colors should be inverted during transformation.

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

## Remarks

* This method applies transformations to the [black-and-white](/fine-reader/engine/guided-tour/advanced-techniques/working-with-images#black-and-white), [gray](/fine-reader/engine/guided-tour/advanced-techniques/working-with-images#gray), and [color](/fine-reader/engine/guided-tour/advanced-techniques/working-with-images#color) image planes of the ImageDocument. All the other pages are deleted from the ImageDocument. They will be created upon demand.
* The sequence of geometrical transformations is as follows: first the rotation by the specified angle is performed, and then the image is mirrored around the vertical axis.
* This method reports events to the listeners attached to the IConnectionPointContainer interface of the ImageDocument object.

## See also

[ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument)

[RotationTypeEnum](/fine-reader/engine/api-reference/enumerations/rotationtypeenum)
