> ## 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 インターフェイスの OnCropImages メソッド

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

このメソッドはクライアント側で実装されます。[Image Viewer](/ja/fine-reader/engine/visual-components-reference/imageviewer) で画像を切り抜く前に、ABBYY FineReader Engine によって呼び出されます。この処理は、Image Editor ダイアログの Crop セクションで <img src="https://mintcdn.com/abbyy/6udH-pkk8zkVafYH/images/fine-reader/engine/button_cropimage.gif?s=01171aff412fa564a011508f39729cc6" alt="Button_CropImage" width="24" height="23" data-path="images/fine-reader/engine/button_cropimage.gif" /> Crop Image ボタンがクリックされると実行されます。

このメソッドは、切り抜き対象となるページのインデックスと、切り抜き矩形の座標をクライアントに渡します。このメソッドを使用すると、この処理をキャンセルできます。

<Accordion title="図を見る">
  <img src="https://mintcdn.com/abbyy/lsETHFYUFiongXSm/images/fine-reader/engine/editimage_crop.png?fit=max&auto=format&n=lsETHFYUFiongXSm&q=85&s=da4fcc9e8ae01338fac290aa6767e753" alt="EditImage_Crop" width="558" height="374" data-path="images/fine-reader/engine/editimage_crop.png" />
</Accordion>

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

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

```cpp theme={null}
HRESULT OnCropImages(
  IIntsCollection* PageIndices,
  IFRRectangle*    Rect,
  VARIANT_BOOL*    Cancel
);
```

### C\#

```csharp theme={null}
void OnCropImages(
  IIntsCollection PageIndices,
  FRRectangle    Rect,
  out bool       Cancel
);
```

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

```vb theme={null}
Sub OnCropImages( _
  PageIndices As IIntsCollection, _
  Rect As FRRectangle, _
  ByRef Cancel As Boolean _
)
```

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

PageIndices

\[in] 切り抜き対象のページのインデックスを [IntsCollection](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/intscollection) オブジェクトとして格納します。

Rect

\[in] 切り抜き矩形を [FRRectangle](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/frrectangle) オブジェクトとして格納します。座標は、ドキュメント画像を基準としたピクセル単位で指定されます。

Cancel

\[out] 処理を中止する場合は、この変数を TRUE に設定できます。この場合、ページは切り抜かれません。

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

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

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

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

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

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