SimpleOCR:SDK Functions – ExtractImgArea

You are here:
< All Topics

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);
Previous SimpleOCR:SDK Functions – CreateMultipleImg
Next SimpleOCR:SDK Functions – FreeImg
Table of Contents
Contact Us for FREE Consultation on Your OCR Project

Share This Story, Choose Your Platform!

OCR Guide
Brands
Compare most popular choices in one cozy and extensive table
Languages
Applications
Go to Top