SimpleOCR:SDK Functions – InsertImage

int InsertImage(SETOFIMG * set, int index, IMG * image)

Inserts an image in a set of image at a given position.

Return Value

If the function fails, a nonzero value is returned.

Parameters

set

A pointer to a set of images of type SETOFIMG.

index

Position of the inserted image, counted from 0.

image

Inserted image.

Example

SETOFIMG *doc; 
IMG *img; 
int nb; 

// Creates an image in img 
... 

// Creates a set 
... 

// Insert the image at the first position 
if (InsertImage(set,0,img)) 
{
// error processing 
...
}
2020-11-11T18:20:55-05:00Tags: , , |

SimpleOCR:SDK Functions AddImage

int AddImage(SETOFIMG * set, IMG * image)

Add an image to a set of image. The new image will be added at the last position.

Return Value

If the function fails, a nonzero value is returned.

Parameters

set

A pointer to a set of images of type SETOFIMG.

image

A pointer to the added image, of type IMG.

Example

SETOFIMG *doc; 
IMG *img; 
int nb; 

// Creates an image in img 
... 

// Creates a set 
doc=<f CreateMultipleImg>(); 
if (doc==NULL) 
{
// error processing 
...
} 

// Add the image 
if (AddImage(set,img)) 
{
// error processing 
...
}
2020-11-09T16:25:20-05:00Tags: , , |

SimpleOCR:SDK Functions

IMG

All the images manipulated by SimpleOCR have the IMG type. SimpleOCR provides functions that allows you to handle an IMG object as a Device Independent Bitmap (DIB). See your Windows SDK documentation in order to become familiar with DIB concepts.

The IMG objects are always manipulated through SimpleOCR functions. So even if IMG objects are implemented as structures, you don’t have to bother with its definition. When programming in languages besides C++, substitute IMG * with Long Integer data types.

Please remember, SimpleOCR can only work with bi-level (i.e. black & white) images or grayscale images with 256 shades of grays.

SETOFIMG

Several images that belong to the same document can be grouped in a SETOFIMG object. The SETOFIMG objects are always manipulated through SimpleOCR functions. So even if IMG objects are implemented as structures, you don’t have to bother with its definition.

When programming in languages besides C++, substitute SETOFIMG * with Long Integer data types.

AddDIB

int AddDIB(SETOFIMG * set, HGLOBAL hDib)

This function is similar to AddImage, except that, instead of an IMG object, this function expects an image in the DIB format.

Return Value

If the function fails, a nonzero value is returned.

Parameters

set

A pointer to a set of images of type SETOFIMG.

hDib

A HGLOBAL handler referencing a Global Memory object containing a BITMAPINFO structure followed by the bitmap bits.

Example

SETOFIMG *doc; 
HGLOBAL hDib; 
int nb; 

// Creates a set 
doc=CreateMultipleImg(); 

if (doc==NULL) 
{
// error processing [...]
2020-11-09T16:15:47-05:00Tags: , , |
Go to Top