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

# IImageViewerEvents インターフェイスの OnCorrectPerspective メソッド

> Windows 上の ABBYY FineReader Engine Visual Components における IImageViewerEvents インターフェイスの OnCorrectPerspective メソッド — このメソッドはクライアント側で実装されます。

このメソッドはクライアント側で実装されます。[Image Viewer](/ja/fine-reader/engine/visual-components-reference/imageviewer) の画像ページで遠近歪みを補正する前に、ABBYY FineReader Engine によって呼び出されます。この処理は、Image Editor ダイアログの 台形歪みの補正 セクションで <img src="https://mintcdn.com/abbyy/6udH-pkk8zkVafYH/images/fine-reader/engine/button_correctperspective.gif?s=4ef7fbae9a000e8921a48e39f7177caa" alt="Button_CorrectPerspective" width="24" height="23" data-path="images/fine-reader/engine/button_correctperspective.gif" /> Correct this image ボタンをクリックすると実行されます。

このメソッドは、変更されるページのインデックスと、新しいページ四隅の座標をクライアントに渡します。このメソッドを使用すると、この処理をキャンセルできます。

<Accordion title="図を参照">
  <img src="https://mintcdn.com/abbyy/lsETHFYUFiongXSm/images/fine-reader/engine/editimage_correctperspective.png?fit=max&auto=format&n=lsETHFYUFiongXSm&q=85&s=c2b67881aabcae51f40a64b521d379b2" alt="EditImage_CorrectPerspective" width="607" height="517" data-path="images/fine-reader/engine/editimage_correctperspective.png" />
</Accordion>

<div id="syntax">
  ## 構文
</div>

<div id="c">
  ### C++
</div>

```cpp theme={null}
HRESULT OnCorrectPerspective(
  int           PageIndex,
  IPoint*       TopLeft,
  IPoint*       TopRight,
  IPoint*       BottomRight,
  IPoint*       BottomLeft,
  VARIANT_BOOL* Cancel
);
```

### C\#

```csharp theme={null}
void OnCorrectPerspective(
  int      PageIndex,
  IPoint    TopLeft,
  IPoint    TopRight,
  IPoint    BottomRight,
  IPoint    BottomLeft,
  out bool Cancel
);
```

<div id="visual-basic-net">
  ### Visual Basic .NET
</div>

```vb theme={null}
Sub OnCorrectPerspective( _
  PageIndex As Integer, _
  TopLeft As IPoint, _
  TopRight As IPoint, _
  BottomRight As IPoint, _
  BottomLeft As IPoint, _
  ByRef Cancel As Boolean _
)
```

<div id="parameters">
  ## パラメータ
</div>

PageIndex

\[in] 台形歪みを補正する対象ページのインデックスを格納します。

TopLeft

\[in] 補正後の画像の新しい左上隅となる、画像上の点の座標を格納します。[Point](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/point) オブジェクトの説明を参照してください。

TopRight

\[in] 補正後の画像の新しい右上隅となる、画像上の点の座標を格納します。[Point](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/point) オブジェクトの説明を参照してください。

BottomRight

\[in] 補正後の画像の新しい右下隅となる、画像上の点の座標を格納します。[Point](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/point) オブジェクトの説明を参照してください。

BottomLeft

\[in] 補正後の画像の新しい左下隅となる、画像上の点の座標を格納します。[Point](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/point) オブジェクトの説明を参照してください。

Cancel

\[out] 処理を中止する必要があることを示すには、この変数を TRUE に設定します。この場合、遠近歪みの補正は行われません。

<div id="return-values">
  ## 戻り値
</div>

\[C++ のみ] このメソッドが S\_OK 以外の値を返した場合は、クライアント側でエラーが発生したことを示します。この場合、Cancel パラメーターの値は考慮されません。

<div id="remarks">
  ## 注記
</div>

このメソッドのクライアント実装では、メソッド内でスローされるすべての例外を確実にキャッチして処理し、いかなる例外もメソッドの外部に伝播しないようにする必要があります。例外がメソッドの外部に伝播すると、予期しない結果 (プログラムの終了など) を招くおそれがあります。

<div id="see-also">
  ## 関連項目
</div>

[IImageViewerEvents](/ja/fine-reader/engine/visual-components-reference/iimageviewerevents)
