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

# Batch オブジェクトの AddImage メソッド

このメソッドは、ファイルから画像を読み込んでバッチに追加します。追加した画像ごとに、バッチ内にドキュメントが作成されます。

> [!NOTE]
>
> 画像の追加時には、画像準備のパラメーター ([**ImageLoadingParams**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/imageloadingparams.md) オブジェクト) が使用されます。これらのパラメーターは、追加先のバッチタイプに関連付けられたパラメーターと同じです。

## 構文

```vb Visual Basic .NET theme={null}
Sub AddImage(Path As String)
```

```cpp C++ theme={null}
HRESULT AddImage(
  BSTR Path
);
```

## パラメーター

**Path**

\[in] この変数には、画像ファイルのフルパスが格納されます。例:「D:\SampleImages\Sample.tif」

## 戻り値

このメソッドには固有の戻り値はありません。[ABBYY FlexiCapture SDK 関数の標準の戻り値](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/errorcodes.md)を返します。

## 備考

* バッチに複数の画像を追加するには、[**Batch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch.md) オブジェクトの [**AddImages**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch-addimages.md) メソッドを使用できます。このメソッドでは、画像追加に関するさまざまなパラメーターを設定できます。
* このメソッドは、[サポートされている形式](https://docs.abbyy.com/ja/flexi-capture/sdk/specifications/digitalinputformats.md)の電子文書を開く際にも使用できます。

## サンプル

> [accordion] C++ (COM) コード
>
> ```cpp theme={null}
> // グローバルな ABBYY FlexiCapture SDK Engine オブジェクト。
> FCEngine::IEnginePtr Engine;
> ...
> // プロジェクトを開く
> FCEngine::IProjectPtr project = Engine->OpenProject("D:\\TestProject\\TestProject.fcproj");
> // 新しいバッチを追加する
> FCEngine::IBatchPtr batch = project->Batches->AddNew( L"TestBatch" );
> // バッチを開く
> batch->Open();
> // バッチに画像を追加する
> batch->AddImage( L"D:\\SampleImages\\0001.tif" );
> ...
> ```

このメソッドは、次のコード サンプルで使用されています：[Hello](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/samples.md#hello)、[Invoices Processing and Training](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/samples.md#invoicesprocessingandtraining)。

## 関連項目

[**Batch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch.md)
