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

# ImageProcessingTools オブジェクトの StretchTrapezoidToRectangle メソッド

このメソッドは、指定した台形が長方形になるように画像を変換します。軽度の遠近歪みを手動で補正する際に使用できます。

## 構文

```vb Visual Basic .NET theme={null}
Function StretchTrapezoidToRectangle( _
  Image As Image, _
  TopLeftX As Integer, _
  TopLeftY As Integer, _
  TopRightX As Integer, _
  TopRightY As Integer, _
  BottomLeftX As Integer, _
  BottomLeftY As Integer, _
  BottomRightX As Integer, _
  BottomRightY As Integer, _
  ResultWidth As Integer, _
  ResultHeight As Integer _
) As Image
```

```cpp C++ theme={null}
HRESULT StretchTrapezoidToRectangle(
  IImage*  Image,
  int      TopLeftX,
  int      TopLeftY ,
  int      TopRightX,
  int      TopRightY ,
  int      BottomLeftX,
  int      BottomLeftY ,
  int      BottomRightX,
  int      BottomRightY ,
  int      ResultWidth,
  int      ResultHeight,
  IImage** Result
);
```

## パラメーター

**Image**

\[in] この変数は、前処理の対象となる [**Image**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/image.md) オブジェクトを参照します。

**TopLeftX**

\[in] 入力画像上での出力画像の左上角の水平座標をピクセル単位で指定します。

**TopLeftY**

\[in] 入力画像上での出力画像の左上角の垂直座標をピクセル単位で指定します。

**TopRightX**

\[in] 入力画像上での出力画像の右上角の水平座標をピクセル単位で指定します。

**TopRightY**

\[in] 入力画像上での出力画像の右上角の垂直座標をピクセル単位で指定します。

**BottomLeftX**

\[in] 入力画像上での出力画像の左下角の水平座標をピクセル単位で指定します。

**BottomLeftY**

\[in] 入力画像上での出力画像の左下角の垂直座標をピクセル単位で指定します。

**BottomRightX**

\[in] 入力画像上での出力画像の右下角の水平座標をピクセル単位で指定します。

**BottomRightY**

\[in] 入力画像上での出力画像の右下角の垂直座標をピクセル単位で指定します。

**ResultWidth**

\[in] 出力画像の幅をピクセル単位で指定します。デフォルト値は -1 で、この場合は幅が自動的に検出されます。

**ResultHeight**

\[in] 出力画像の高さをピクセル単位で指定します。デフォルト値は -1 で、この場合は高さが自動的に検出されます。

**Result**

\[out, retval] 出力画像へのアクセスを提供する [**IImage**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/image.md)\*\*\*\*\* ポインター変数へのポインターです。

## 戻り値

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

## 関連項目

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