Click or drag to resize

OcrPixFromRaw Method

Creates new instance of OcrPix class.

Namespace: Patagames.Ocr
Assembly: Patagames.Ocr (in Patagames.Ocr.dll) Version: 4.6.411
Syntax
public static OcrPix FromRaw(
	IntPtr scan0,
	int bpp,
	int stride,
	int width,
	int height,
	int spp,
	RGBA_Quad[] palette,
	int xRes,
	int yRes
)

Parameters

scan0  IntPtr
The address of the first pixel data in the bitmap. This can also be thought of as the first scan line in the bitmap.
bpp  Int32
Bits per Pixel
stride  Int32
The stride width in bytes (also called scan width) of the image
width  Int32
Width of the image.
height  Int32
Height of the image.
spp  Int32
Samples per pixel.
palette  RGBA_Quad
Palette for indexed images
xRes  Int32
The horizontal resolution, in pixels per inch, of this OcrPix.
yRes  Int32
The vertical resolution, in pixels per inch, of this OcrPix.

Return Value

OcrPix
The new instance of OcrPix class.
Exceptions
ExceptionCondition
UnsupportedFormatExeptionThe given bpp is not supported.
OcrExceptionUnable to create image for some reason.
Remarks
Greyscale of 8 and color of 24 or 32 bits per pixel may be given. Palette color images will not work properly and must be converted to 24 bit. Binary images of 1 bit per pixel may also be given but they must be byte packed with the MSB of the first byte being the first pixel, and a 1 represents WHITE. For binary images set bytes_per_pixel= 0. The data should be in bgr format.
See Also