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

# ConvertCoordinates Method of the CoordinatesConverter Object

This method converts coordinates of a pixel between different modification states or image planes of the [ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument).

## Syntax

### C++

```cpp theme={null}
HRESULT ConvertCoordinates(
  ImageTypeEnum FromPage,
  ImageTypeEnum ToPage,
  int*          X,
  int*          Y
);
```

### C\#

```csharp theme={null}
void ConvertCoordinates(
  ImageTypeEnum FromPage,
  ImageTypeEnum ToPage,
  out int       X,
  out int       Y
);
```

### Visual Basic .NET

```vb theme={null}
Sub ConvertCoordinates( _
  FromPage As ImageTypeEnum, _
  ToPage As ImageTypeEnum, _
  ByRef X As Integer, _
  ByRef Y As Integer _
)
```

## Parameters

FromPage

\[in] This variable of the [ImageTypeEnum](/fine-reader/engine/api-reference/enumerations/imagetypeenum) type specifies the image page from which the coordinates of pixel are to be converted.

ToPage

\[in] This variable of the [ImageTypeEnum](/fine-reader/engine/api-reference/enumerations/imagetypeenum) type specifies the image page to which the coordinates of pixel are to be converted.

X

\[in, out] This variable stores the horizontal coordinate of the pixel relative to the source image page before the method call, and the horizontal coordinate of the pixel relative to the target image page after the method call.

Y

\[in, out] This variable stores the vertical coordinate of the pixel relative to the source image page before the method call, and the vertical coordinate of the pixel relative to the target image page after the method call.

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

* The coordinates of pixels on the black-and-white image page and the color image page are the same.
* The method will return an error if you attempt to convert coordinates to or from a [preview](/fine-reader/engine/guided-tour/advanced-techniques/working-with-images#preview) image plane that hasn't been created yet.

<Warning>
  An image modification, automatic or manual, may reset the preview image plane created earlier, and you will not be able to convert coordinates to or from that preview. Before converting coordinates, call the [GetPreviewImage](/fine-reader/engine/api-reference/image-related-objects/imagedocument/getpreviewimage-method) method again if the image was modified.
</Warning>

## See also

[ImageTypeEnum](/fine-reader/engine/api-reference/enumerations/imagetypeenum)

[CoordinatesConverter](/fine-reader/engine/api-reference/image-related-objects/coordinatesconverter)

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