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.
このメソッドは Linux および macOS では実装されていません
このメソッドは、メモリ内のバッファから学習用画像データを設定します。
画像は等方性である必要があります。つまり、水平方向と垂直方向の解像度が同じでなければなりません。また、1 ピクセルあたり 1 ビットで符号化された白黒画像である必要があります。
画像は、上から下へ行単位で連続してバッファに格納されます。白黒画像の 1 行は、少なくとも N = ceil ( width / 8 ) バイトの並びとして格納されます。各バイトは隣接する 8 ピクセルの色を表し、最初のバイトの最上位ビットがその行の最も左のピクセルに対応します。ビット値 0 は白ピクセル、1 は黒ピクセルを表します。width が 8 の倍数でない場合、N-番目のバイトの下位ビットは無視されます。
HRESULT SetBitmapBits(
int Height,
int Width,
__int64 RawDataPointer
);
void SetBitmapBits(
int Height,
int Width,
Int64 RawDataPointer
);
Sub SetBitmapBits( _
Height As Integer, _
Width As Integer, _
RawDataPointer As Int64 _
)
Height
[in] 学習用画像の高さをピクセル単位で指定します。
Width
[in] 学習用画像の幅をピクセル単位で指定します。
RawDataPointer
[in] このパラメーターは、画像データを含むメモリバッファへのハンドルとして扱われます。ハンドルは __int64 型で渡されます。
Windows の場合: このメソッドに固有の戻り値はありません。ABBYY FineReader Engine 関数の標準的な戻り値が返されます。
Linux および macOS の場合: このメソッドは E_NOTIMPL を返します。
対応する TrainingImage オブジェクトが存在している間は、画像データも保持されている必要があります。
// ビットマップの形式は、FineReader Engine の形式と同じである必要があります。
// 画像が別の形式の場合は、Image.GetBitmap メソッドを使用できます。
// IntPtr hBitmap = document.Pages[0].ImageDocument.BlackWhiteImage.GetBitmap(null).Handle;
// Bitmap bitmap = new Bitmap( Image.FromHbitmap( hBitmap ) );
Bitmap bitmap = new Bitmap(imagePath);
Rectangle imageRect = new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height);
System.Drawing.Imaging.BitmapData data = bitmap.LockBits(imageRect, System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format1bppIndexed);
FREngine.ITrainingImage trainingImage = engineLoader.Engine.CreateTrainingImage();
trainingImage.SetBitmapBits(bitmap.Size.Height, bitmap.Size.Width, data.Scan0.ToInt64());
TrainingImage