Nicomsoft OCR: Developer's Guide


Img_LoadBmpData


Syntax

C++:int Img_LoadBmpData(HIMG ImgObj, unsigned char* Bytes, int Width, int Height, int Flags, int Stride)
C#:int Img_LoadBmpData(int ImgObj, out System.Array Bytes, int Width, int Height, int Flags, int Stride)
Visual Basic:Function Img_LoadBmpData(ByVal ImgObj As Integer, ByRef Bytes As System.Array, ByVal Width As Integer, ByVal Height As Integer, ByVal Flags As Integer, ByVal Stride As Integer) As Integer
Java:int Img_LoadBmpData(HIMG ImgObj, int[] Bits, int Width, int Height, int Flags)
Delphi:function Img_LoadBmpData(ImgObj:HIMG; Bits:PBYTE; Width:integer; Height:integer; Flags:integer; Stride:integer):integer


Description

Loads an image pixels array from the memory to the Image object. The difference from the Img_LoadFromMemory function is that this function accepts a pointer to the raw RGB bitmap pixels, not to the image data.


Parameters

ImgObj [IN] – the Image object.
Bytes [IN] – a pointer to the byte array that contains the image bitmap data.
Width [IN] – the bitmap width, in pixels.
Height [IN] – the bitmap height, in pixels.
Flags [IN] – the flags. See the BMP_XXXXX constants for possible values.
Stride [IN] – the image stride, in bytes. Specify zero for autocalculation (standard 4-bytes padding).


Return value

Zero if success, otherwise an error code.


Remarks

This function can load raw RGB bitmap data only. If you want to load a picture stored in an image format (BMP, JPEG, PNG, etc.) from the memory, use the Img_LoadFromMemory function instead.
Java: This function supports only ARGB bitmap data, that is, four bytes per pixel (the "BMP_32BIT" constant), and the default stride (4-bytes padding).


Example

See the sample projects in the NSOCR SDK.