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

# IZoomViewerEvents インターフェイスの OnToolChangeBlockRegion メソッド

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

このメソッドはクライアント側で実装されます。[Image Viewer](/ja/fine-reader/engine/visual-components-reference/imageviewer) の次のいずれかのツールを使って [Zoom Viewer](/ja/fine-reader/engine/visual-components-reference/zoomviewer) で変更したブロック領域を変更する前に、ABBYY FineReader Engine によって呼び出されます。

* <img src="https://mintcdn.com/abbyy/i-EfCQVmseNiPQcp/images/fine-reader/engine/tb_addpart.gif?s=adca0dfae4207e8af75ec13fa1315932" alt="tb_addPart" width="23" height="22" data-path="images/fine-reader/engine/tb_addpart.gif" /> ブロック部分を追加 ([MI\_ChooseTool\_AddBlockPart](/ja/fine-reader/engine/visual-components-reference/imageviewer/image-viewer-commands#mi_choosetool_addblockpart))
* <img src="https://mintcdn.com/abbyy/i-EfCQVmseNiPQcp/images/fine-reader/engine/tb_delpart.gif?s=da5355ff634033aeff15f5b6429e59aa" alt="tb_delPart" width="23" height="22" data-path="images/fine-reader/engine/tb_delpart.gif" /> ブロック部分を切り取る ([MI\_ChooseTool\_CutBlockPart](/ja/fine-reader/engine/visual-components-reference/imageviewer/image-viewer-commands#mi_choosetool_cutblockpart))

これらのツールの選択方法については、[Image Viewer Commands](/ja/fine-reader/engine/visual-components-reference/imageviewer/image-viewer-commands) の説明を参照してください。

このメソッドは、領域が変更されたブロックと、変更後のブロックの新しい領域に関する情報をクライアントに渡します。また、このメソッドを使用して操作をキャンセルすることもできます。

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

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

```cpp theme={null}
HRESULT OnToolChangeBlockRegion(
  IIntsCollection*  blocksToChange,
  IRegion*          NewRegion,
  VARIANT_BOOL*     Cancel
);
```

### C\#

```csharp theme={null}
void OnToolChangeBlockRegion(
  IIntsCollection  blocksToChange,
  Region          NewRegion,
  out bool        Cancel
);
```

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

```vb theme={null}
Sub OnToolChangeBlockRegion( _
  blocksToChange As IIntsCollection, _
  NewRegion As Region, _
  ByRef Cancel As Boolean _
)
```

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

blocksToChange

\[in] 変更されたブロックのインデックスを [IntsCollection](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/intscollection) オブジェクトとして格納します。

NewRegion

\[in] 変更後のブロックの新しい領域を [Region](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/region) オブジェクトとして格納します。

Cancel

\[out] この変数を TRUE に設定すると、処理を中止するよう指定できます。この場合、ブロックの領域は変更されません。

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

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

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

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

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

[IZoomViewerEvents](/ja/fine-reader/engine/visual-components-reference/izoomviewerevents)
