SimpleOCR:SDK Functions – ShrinkImg

IMG * ShrinkImg(IMG * img, int nw, int nh)

Shrinks a bi-level image and returns the result in a grayscale image.

Return Value

A pointer to a new IMG object. If the function fails, the return value is NULL.

Parameters

img

Pointer to an image of type IMG.

nw

Width of the new image.

nh

Height of the new image.

Comments

The original image is left unchanged. If you don’t need it anymore, you have to free it by calling the FreeImg function. This function is mainly useful when you want to display a reduced bi-level image with a good display quality.

Example

IMG *img,img2; 

// Create an IMG 
... 
img2=ShrinkImg(img,640,480); 

if (img2==NULL) 
{
// Error processing 
...
}