SimpleOCR:SDK Functions – ExtractImgArea
IMG * ExtractImgArea(IMG * img, int x, int y, int w, int h)
Extracts a rectangular area from an 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.
x
x coordinate of the upper left corner of the area.
y
y coordinate of the upper left corner of the area.
w
area width in pixels.
h
area height in pixels.
Comments
The original image is left unchanged. The extract image should be freed with the function FreeImg
Example
IMG *img,img2;
// Create an IMG
...
img2=WIMGExtract(img,10,20,300,100);
if (img2==NULL)
{
// Error processing
...
}
// Use the extracted Image
...
// Free it
FreeImg(img2);