Skip to main content

What it does

Represents the image of a page or a region. The object implements the IPicture interface and provides access to some of its properties through the IDispatch interface. For more details about the IPicture interface, see the corresponding article at MSDN. Note. This object is not available on the Web Verification Station for checking rules locally.

Methods

Definition

Description

AnalyzePageObjects( [optional] reserved: Object ) : IPictureObjectsInfo

Defines objects on the page and returns the parameters of the page as seen by the recognition module. Some delay in the operation is possible.

CalcSuitabilityForOCR(): float

Shows how suitable is an image for OCR. Possible values are from 0.0 to 1.0.

Example

This script records results of method’s operation for the selected documents to a page comment by clicking a user button:

foreach( IDocument doc in MainWindow.Selection.Documents )
{
MainWindow.TaskWindow.OpenDocument( doc );
foreach( IPage page in doc.Pages )
{
IPictureObject picture = page.Picture;
       double score = (double)picture.CalcSuitabilityForOCR();
       bool verdict = (bool)picture.IsSuitableForOcr();
       page.Comment = score.ToString( “0.0000” ) + ” / ” + verdict.ToString();
}
}

CreateEditableCopy() : IEditablePictureObject

Creates an editable copy of the image.

DetectPageOrientation( [optional] language: string ) : int

Detects page orientation by the text on it. The internal name of the language is passed as the input parameter. If the language is not specified, the language of the current locale is used. Returns the angle (in degrees) to which the page must be rotated. The following values can be returned: 0, 90, 180 and 270.

IsPhoto(): bool

Shows whether an image is a photo.

IsSuitableForOcr(): bool

Shows whether an image is suitable for OCR.

SaveAs( filename : string, [optional] options : IExportImageSavingOptions )

Saves the image. If no options are specified, the image is saved as *.tif.

Properties

Name

Type

Access

Description

Handle

OLE_HANDLE

Read-only

The Windows GDI handle of the picture.

In .NET this property can be used in System.Drawing.Image.FromHbitmap method to retrieve the picture object.

Height

int

Read-only

The height of the picture in dots

hPal

OLE_HANDLE

Read/write, Mutable (can be modified even in scripts with read-only permissions)

The Windows handle of the palette used by the picture.

This property can be used in System.Drawing.Image.FromHbitmap as a second parameter.

IsBlackWhite

bool

Read-only

Whether the picture is black-and-white.

IsColor

bool

Read-only

Whether the picture is color.

IsGrayscale

bool

Read-only

Whether the picture is grayscale.

Type

SHORT

Read-only

The type of picture.

Width

int

Read-only

The width of the picture in dots

XResolution

int

Read-only

The horizontal image resolution

YResolution

int

Read-only

The vertical image resolution