SignDoc SDK (.NET without exceptions)  5.0.0
SignDocImage Class Reference

A bitmap image. More...

Public Member Functions

 ~SignDocImage ()
 Destructor. More...
 
 !SignDocImage ()
 Finalizer. More...
 
 SignDocImage ()
 Constructor. More...
 
 SignDocImage (SignDocImage aSource)
 Copy constructor. More...
 
SignDocImage clone ()
 Create a copy of this object. More...
 
void clear ()
 Remove the image from this object. More...
 
void setEmpty (out ReturnCode aReturnCode, int aWidth, int aHeight, int aBitsPerPixel, int aColor)
 Replace this image with an empty one of the specified size. More...
 
void loadFromMemory (out ReturnCode aReturnCode, byte[] aData, int aIndex)
 Load an image from a blob. More...
 
void loadFromFile (out ReturnCode aReturnCode, string aPath, int aIndex)
 Load an image from a file. More...
 
int getNumberOfPagesFromMemory (out ReturnCode aReturnCode, byte[] aData)
 Get the number of subimages (pages) in a blob. More...
 
int getNumberOfPagesFromFile (out ReturnCode aReturnCode, string aPath)
 Get the number of subimages (pages) in a file. More...
 
int getBitsPerPixel ()
 Get the number of bits per pixel. More...
 
int getNumberOfComponents ()
 Get the number of components. More...
 
int getBitsPerComponent ()
 Get the number of bits per component. More...
 
int getWidth ()
 Get the width of the image. More...
 
int getHeight ()
 Get the height of the image. More...
 
int getResolutionX ()
 Get the horizontal resolution of the image. More...
 
int getResolutionY ()
 Get the vertical resolution of the image. More...
 
void setResolution (out ReturnCode aReturnCode, int aResolutionX, int aResolutionY)
 Set the resolution of the image. More...
 
void resizeToResolution (out ReturnCode aReturnCode, int aResolutionX, int aResolutionY, string aFilter)
 Resize the image. More...
 
void crop (out ReturnCode aReturnCode, int aX, int aY, int aWidth, int aHeight)
 Crop the image. More...
 
void convertToBiLevel (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters)
 Convert the image to bi-level black and white. More...
 
void convertToGrayscale (out ReturnCode aReturnCode)
 Convert the image to 8-bit grayscale. More...
 
void convertToTrueColor (out ReturnCode aReturnCode)
 Convert the image to 24-bit RGB (8 bits per color channel). More...
 
void invert (out ReturnCode aReturnCode, bool aAuto)
 Invert the image. More...
 
void rotate (out ReturnCode aReturnCode, int aAngle, int aBackgroundColor)
 Rotate the image. More...
 
void mirrorX (out ReturnCode aReturnCode)
 Mirror along the vertical axis (flip horizontally). More...
 
void mirrorY (out ReturnCode aReturnCode)
 Mirror along the horizontal axis (flip vertically). More...
 
int getPixelValue (out ReturnCode aReturnCode, int aX, int aY)
 Get the value of a pixel. More...
 
void setPixelValue (out ReturnCode aReturnCode, int aX, int aY, int aValue)
 Set the value of a pixel. More...
 
int getPixelRGB (out ReturnCode aReturnCode, int aX, int aY)
 Get the RGB color of a pixel. More...
 
void setPixelRGB (out ReturnCode aReturnCode, int aX, int aY, int aColor)
 Set the RGB color of a pixel. More...
 
void drawLine (out ReturnCode aReturnCode, int aX1, int aY1, int aX2, int aY2, double aStrokeWidth, int aColor)
 Draw a line. More...
 
void drawRect (out ReturnCode aReturnCode, int aX1, int aY1, int aX2, int aY2, double aRadiusX, double aRadiusY, double aStrokeWidth, int aColor, bool aFill)
 Draw a rectangle (with both lines parallel to the axes). More...
 
void drawRect (out ReturnCode aReturnCode, SignDocImageRect aRect, double aRadiusX, double aRadiusY, double aStrokeWidth, int aColor, bool aFill)
 Draw a rectangle (with both lines parallel to the axes). More...
 
int[] getPalette (out ReturnCode aReturnCode)
 Get the palette. More...
 
void setPaletteAt (out ReturnCode aReturnCode, int aIndex, int aColor)
 Set a palette entry. More...
 
int[] getHistogram (out ReturnCode aReturnCode)
 Compute a histogram. More...
 
int getComplexity (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters)
 Compute the complexity of a signature image. More...
 
void clean (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters, SignDocCleanParameters aCleanParameters)
 Clean a signature image according to the provided parameters. More...
 
SignDocImageRect cleanSignature (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters)
 Clean a signature image. More...
 
void cleanLines (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters)
 Clean lines. More...
 
SignDocImageRect cleanDate (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters)
 Remove handwritten text from the signature image. More...
 
void cleanFrames (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters, double aTrust)
 Clean frames. More...
 
SignDocImageRect removeMargins (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters)
 Remove white margins. More...
 
SignDocWeightedFrame[] getFrames (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters)
 Get the frames of the image. More...
 
int[] getSplitPositions (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters)
 Get the vertical split positions of the image. More...
 
SignDocMatchResult matchImage (out ReturnCode aReturnCode, SignDocImage aOther, SignDocMatchParameters aMatchParameters)
 Match against a signature image. More...
 
SignDocMatchResult matchSignature (out ReturnCode aReturnCode, SignDocSignatureData aOther, SignDocMatchParameters aMatchParameters, SignDocImageParameters aImageParameters)
 Match against a signature. More...
 
SignDocMatchResult matchReference (out ReturnCode aReturnCode, SignDocSignatureData aOther, SignDocMatchParameters aMatchParameters, SignDocImageParameters aImageParameters)
 Match against a reference. More...
 
byte[] saveToMemory (out ReturnCode aReturnCode, SignDocImageParameters aParameters)
 Save this image as a blob. More...
 
byte[] saveToMemory2 (out ReturnCode aReturnCode, string aFormat)
 Save this image as a blob. More...
 
void saveToFile (out ReturnCode aReturnCode, string aPath, SignDocImageParameters aParameters)
 Save this image to a file. More...
 
void saveToFile2 (out ReturnCode aReturnCode, string aPath, string aFormat)
 Save this image to a file. More...
 
string getErrorMessage ()
 Get an error message for the last function call. More...
 

Detailed Description

A bitmap image.

This class supports images with 1 bit per pixel (bi-level, with RGB palette), 8 bits per pixel (indexed, with RGB palette), and 24 bits per pixel (RGB, 256 levels per color channel). RGB colors are specified as integers of the form 0x00rrggbb (rr is the red component, gg is the green component, bb is the blue component). All three components have values 0 (off) through 255 (on): 0x000000 is black, 0xffffff is white.

Some functions assume (for computing the intensity) that the color profile is sRGB.

Images that have transparent pixels are not supported.

The origin of the coordinate system is in the upper left corner, see Coordinate Systems.

See also
SignDocColor.getRGB()

Constructor & Destructor Documentation

Destructor.

Finalizer.

Constructor.

This object won't contain an image, getWidth() and getHeight() will return 0.

See also
setEmpty(), setResolution()
SignDocImage ( SignDocImage  aSource)

Copy constructor.

Parameters
[in]aSourceThe object to be copied.

Member Function Documentation

void clean ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters,
SignDocCleanParameters  aCleanParameters 
)

Clean a signature image according to the provided parameters.

This function performs multiple clean operations with a single call.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
[in]aCleanParametersActions and parameters.
See also
cleanDate(), cleanFrames(), cleanLines(), cleanSignature(), convertToBiLevel(), convertToGrayscale(), convertToTrueColor(), crop(), invert(), mirrorX(), mirrorY(), rotate()
SignDocImageRect cleanDate ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters 
)

Remove handwritten text from the signature image.

Handwritten text (such as a date) will be removed from the signature image. Dirt, lines, and machine-printed text must be removed before calling this function.

After cleaning, the image will be cropped to the signature region.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.

If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
A rectangle bounding the signature region within the original image.
See also
clean(), cleanFrames(), cleanLines(), cleanSignature()
void cleanFrames ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters,
double  aTrust 
)

Clean frames.

This function removes all frames that have a weight smaller than aTrust.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
[in]aTrustMinimum frame weight (0.0 through 1.0). 0.0 removes dirt, 1.0 removes all frames.
See also
clean(), cleanDate(), cleanLines(), cleanSignature(), getFrames()
void cleanLines ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters 
)

Clean lines.

Horizontal and vertical lines will be removed.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
See also
clean(), cleanDate(), cleanFrames(), cleanSignature()
SignDocImageRect cleanSignature ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters 
)

Clean a signature image.

This function cleans horizontal Lines, printed text, and dirt not being part of a signature.

After cleaning, the image will be cropped to the signature region.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.

If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
A rectangle bounding the signature region within the original image.
See also
clean(), cleanDate(), cleanFrames(), cleanLines()
void clear ( )

Remove the image from this object.

See also
setEmpty()
SignDocImage clone ( )

Create a copy of this object.

Returns
The new object.
void convertToBiLevel ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters 
)

Convert the image to bi-level black and white.

This function uses thresholding.

Unlike SignWare's SPImageBinarize(), this function never inverts the image.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
See also
convertToGrayscale(), convertToTrueColor()
void convertToGrayscale ( out ReturnCode  aReturnCode)

Convert the image to 8-bit grayscale.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
See also
convertToBiLevel(), convertToTrueColor()
void convertToTrueColor ( out ReturnCode  aReturnCode)

Convert the image to 24-bit RGB (8 bits per color channel).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
See also
convertToBiLevel(), convertToGrayscale()
void crop ( out ReturnCode  aReturnCode,
int  aX,
int  aY,
int  aWidth,
int  aHeight 
)

Crop the image.

The the rectangle to be preserved must lie completely within the current image.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aXThe X coordinate of the upper left corner of the rectangle that will be preserved.
[in]aYThe Y coordinate of the upper left corner of the rectangle that will be preserved.
[in]aWidthThe width of the rectangle that will be preserved. Must be positive.
[in]aHeightThe height of the rectangle that will be preserved. Must be positive.
See also
getWidth(), getHeight(), getResolutionX(), getResolutionY(), removeMargins(), resizeToResolution(), rotate()
void drawLine ( out ReturnCode  aReturnCode,
int  aX1,
int  aY1,
int  aX2,
int  aY2,
double  aStrokeWidth,
int  aColor 
)

Draw a line.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aX1X coordinate of the first endpoint of the line.
[in]aY1Y coordinate of the first endpoint of the line.
[in]aX2X coordinate of the second endpoint of the line.
[in]aY2Y coordinate of the second endpoint of the line.
[in]aStrokeWidthStroke width in pixels (need not be an integer, 0 for minimum width).
[in]aColorThe RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image.
See also
drawRect(), setPixelRGB()
void drawRect ( out ReturnCode  aReturnCode,
int  aX1,
int  aY1,
int  aX2,
int  aY2,
double  aRadiusX,
double  aRadiusY,
double  aStrokeWidth,
int  aColor,
bool  aFill 
)

Draw a rectangle (with both lines parallel to the axes).

If aRadiusX and aRadiusY are positive, a quarter ellipse will be drawn in each corner. If aRadiusX or aRadiusY is zero, a normal rectangle will be drawn.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aX1X coordinate of the first corner of the rectangle.
[in]aY1Y coordinate of the first corner of the rectangle.
[in]aX2X coordinate of the opposite corner of the rectangle.
[in]aY2Y coordinate of the opposite corner of the rectangle.
[in]aRadiusXHorizontal radius of quarter ellipse.
[in]aRadiusYVertical radius of quarter ellipse.
[in]aStrokeWidthStroke width in pixels (need not be an integer, 0 for minimum width).
[in]aColorThe RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image.
[in]aFilltrue to fill interior of rectangle, false to stroke border. For filling you might want do use 0 for aStrokeWidth as the stroked rectangle will be filled, that is, the outer dimensions of the rectangle don't depend on aFill.
See also
drawLine(), setPixelRGB()
void drawRect ( out ReturnCode  aReturnCode,
SignDocImageRect  aRect,
double  aRadiusX,
double  aRadiusY,
double  aStrokeWidth,
int  aColor,
bool  aFill 
)

Draw a rectangle (with both lines parallel to the axes).

If aRadiusX and aRadiusY are positive, a quarter ellipse will be drawn in each corner. If aRadiusX or aRadiusY is zero, a normal rectangle will be drawn.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aRectThe rectangle (does not need to be normalized).
[in]aRadiusXHorizontal radius of quarter ellipse.
[in]aRadiusYVertical radius of quarter ellipse.
[in]aStrokeWidthStroke width in pixels (need not be an integer, 0 for minimum width).
[in]aColorThe RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image.
[in]aFilltrue to fill interior of rectangle, false to stroke border. For filling you might want do use 0 for aStrokeWidth as the stroked rectangle will be filled, that is, the outer dimensions of the rectangle don't depend on aFill.
See also
drawLine(), setPixelRGB()
int getBitsPerComponent ( )

Get the number of bits per component.

Returns
The number of bits per component: 0 (no image), 1 (bi-level), or 8.
See also
getBitsPerPixel(), getNumberOfComponents()
int getBitsPerPixel ( )

Get the number of bits per pixel.

This function returns the product of the return values of getNumberOfComponents() and getBitsPerComponent().

Returns
The number of bits per pixel: 0 (no image), 1 (bi-level), 8 (indexed), or 24 (RGB).
See also
getBitsPerComponent(), getHeight(), getNumberOfComponents(), getWidth()
int getComplexity ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters 
)

Compute the complexity of a signature image.

The computed complexity is valid only if this object contains a clean signature image.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
The complexity of the signature in the range 0 (simplest) through 100 (most complex).
See also
clean()
string getErrorMessage ( )

Get an error message for the last function call.

Returns
A string describing the reason for the failure of the last function call. The string is empty if the last call succeeded.
SignDocWeightedFrame [] getFrames ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters 
)

Get the frames of the image.

This function computes the frames and their weights. Frame weights are floating-point numbers in the range 0.0 through 1.0: 0.0 identifies dirt, 1.0 identifies frames that are part of a signature.

If the image is not a bi-level image, this function will create a temporary bi-level image.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
The frames.
Note
The WinRT component returns null instead of an empty array.
See also
cleanFrames(), getSplitPositions()
int getHeight ( )

Get the height of the image.

Returns
The height of the image (in pixels), 0 if there is no image.
See also
getBitsPerPixel(), getWidth(), resizeToResolution()
int [] getHistogram ( out ReturnCode  aReturnCode)

Compute a histogram.

This function computes an array of integers the same size as the palette returned by getPalette(). Element i tells how many pixels use palette entry i.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The histogram. The array will be empty if the image does not use a palette.
Note
The WinRT component returns null instead of an empty array.
See also
getBitsPerPixel(), getPalette()
int getNumberOfComponents ( )

Get the number of components.

Returns
The number of components: 0 (no image), 1 (indexed), or 3 (RGB).
See also
getBitsPerComponent(), getBitsPerPixel()
int getNumberOfPagesFromFile ( out ReturnCode  aReturnCode,
string  aPath 
)

Get the number of subimages (pages) in a file.

This function opens the file, gets the number of subimages from the file, and closes the file.

This SignDocImage object is used only for storing any error message.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPathThe pathname of the file to be read.
Returns
The number of subimages (pages).
See also
getNumberOfPagesFromMemory(), loadFromFile()
int getNumberOfPagesFromMemory ( out ReturnCode  aReturnCode,
byte[]  aData 
)

Get the number of subimages (pages) in a blob.

This SignDocImage object is used only for storing any error message.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aDataA blob containing an image in BMP (Windows bitmap), TIFF, PNG, or GIF format.
Returns
The number of subimages (pages).
See also
getNumberOfPagesFromFile(), loadFromMemory()
int [] getPalette ( out ReturnCode  aReturnCode)

Get the palette.

This function gets the palette of the image as an array of integers representing RGB colors (0x00rrggbb). The array will contain 2 elements if getBitsPerPixel() returns 1, 256 elements if getBitsPerPixel() returns 8, or 0 elements otherwise (the image does not use a palette).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The palette.
Note
The WinRT component returns null instead of an empty array.
See also
getBitsPerPixel(), getHistogram()
int getPixelRGB ( out ReturnCode  aReturnCode,
int  aX,
int  aY 
)

Get the RGB color of a pixel.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aXX coordinate.
[in]aYY coordinate.
Returns
The RGB color (0x00rrggbb) of the pixel.
See also
getPixelValue(), setPixelRGB()
int getPixelValue ( out ReturnCode  aReturnCode,
int  aX,
int  aY 
)

Get the value of a pixel.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aXX coordinate.
[in]aYY coordinate.
Returns
The value of the pixel. If getBitsPerPixel() returns 1 or 8, this is the index into the palette, if getBitsPerPixel() returns 24, this is the RGB color (0x00rrggbb).
See also
getHistogram(), getPixelRGB(), setPixelValue()
int getResolutionX ( )

Get the horizontal resolution of the image.

Returns
The horizontal resolution of the image in DPI, 0 if there is no image.
See also
getResolutionY(), setResolution()
int getResolutionY ( )

Get the vertical resolution of the image.

Returns
The vertical resolution of the image in DPI, 0 if there is no image.
See also
getResolutionX(), setResolution()
int [] getSplitPositions ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters 
)

Get the vertical split positions of the image.

If the image is not a bi-level image, this function will create a temporary bi-level image.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
The X coordinates of the split positions, ordered by importance, most important first.
Note
The WinRT component returns null instead of an empty array.
See also
getFrames()
int getWidth ( )

Get the width of the image.

Returns
The width of the image (in pixels), 0 if there is no image.
See also
getBitsPerPixel(), getHeight(), resizeToResolution()
void invert ( out ReturnCode  aReturnCode,
bool  aAuto 
)

Invert the image.

It is unspecified whether inverting is done by modifying the palette or by modifying the pixels.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aAutofalse to invert the image unconditionally, true to invert the image only if more than half the pixels have brightness (0 through 255) less than 128.
void loadFromFile ( out ReturnCode  aReturnCode,
string  aPath,
int  aIndex 
)

Load an image from a file.

This function opens the file, loads the image from the file, and closes the file.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPathThe pathname of the file to be read.
[in]aIndex0-based page number for selecting a subimage (page) of the source image.
See also
getNumberOfPagesFromFile(), loadFromMemory(), saveToFile()
void loadFromMemory ( out ReturnCode  aReturnCode,
byte[]  aData,
int  aIndex 
)

Load an image from a blob.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aDataA blob containing an image in BMP (Windows bitmap), TIFF, PNG, or GIF format.
[in]aIndex0-based page number for selecting a subimage (page) of the source image.
See also
getNumberOfPagesFromMemory(), loadFromFile(), saveToMemory(), saveToMemory2()
SignDocMatchResult matchImage ( out ReturnCode  aReturnCode,
SignDocImage  aOther,
SignDocMatchParameters  aMatchParameters 
)

Match against a signature image.

The license must allow comparing signatures.

Note
Only the static matching engine can be used.
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aOtherThe signature image to match against.
[in]aMatchParametersParameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value.
Returns
A new SignDocMatchResult object.
See also
clean(), matchSignature()
SignDocMatchResult matchReference ( out ReturnCode  aReturnCode,
SignDocSignatureData  aOther,
SignDocMatchParameters  aMatchParameters,
SignDocImageParameters  aImageParameters 
)

Match against a reference.

This function fails if aOther does not have type SignatureDataType.Reference.

The license must allow comparing signatures.

Note
Only the static matching engine can be used.
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aOtherThe reference to match against.
[in]aMatchParametersParameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value.
[in]aImageParametersParameters controlling how signature are rendered as images for static matching. If this argument is null, all parameters will be set to their respective default value. String parameter "Format" will be ignored.
Returns
A new SignDocMatchResult object.
See also
clean(), matchSignature(), SignDocSignatureData.matchReference()
SignDocMatchResult matchSignature ( out ReturnCode  aReturnCode,
SignDocSignatureData  aOther,
SignDocMatchParameters  aMatchParameters,
SignDocImageParameters  aImageParameters 
)

Match against a signature.

If aOther has type SignatureDataType.Reference, SignDocSignatureData.selectSignature() must be called once for aOther before calling this function.

This function fails if aOther has type SignatureDataType.Empty.

The license must allow comparing signatures.

Note
Only the static matching engine can be used.
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aOtherThe signature or reference to match against.
[in]aMatchParametersParameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value.
[in]aImageParametersParameters controlling how signature are rendered as images for static matching. If this argument is null, all parameters will be set to their respective default value. String parameter "Format" will be ignored.
Returns
A new SignDocMatchResult object.
See also
clean(), matchImage(), matchReference(), SignDocSignatureData.matchSignature()
void mirrorX ( out ReturnCode  aReturnCode)

Mirror along the vertical axis (flip horizontally).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
See also
mirrorY(), rotate()
void mirrorY ( out ReturnCode  aReturnCode)

Mirror along the horizontal axis (flip vertically).

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
See also
mirrorX(), rotate()
SignDocImageRect removeMargins ( out ReturnCode  aReturnCode,
SignDocImageParameters  aImageParameters 
)

Remove white margins.

This function removes white margins ignoring single black pixels.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.

If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
A rectangle bounding the signature region within the original image.
See also
clean(), cleanSignature(), crop()
void resizeToResolution ( out ReturnCode  aReturnCode,
int  aResolutionX,
int  aResolutionY,
string  aFilter 
)

Resize the image.

This function may change the pixel format.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aResolutionXThe new horizontal resolution of the image in DPI. Must be positive.
[in]aResolutionYThe new vertical resolution of the image in DPI. Must be positive.
[in]aFilterThe resampling filter, an empty string for the default filter. The following filters are available (case-sensitive):
  • "box": box scaling (fastest)
  • "bilinear": bilinear filter
  • "b-spline": B-Spline filter
  • "bicubic": Bicubic filter (default)
  • "catmull-rom": Catmull-Rom filter
  • "lanczos": Lanczos filter
See also
crop(), getWidth(), getHeight(), getResolutionX(), getResolutionY(), rotate(), setResolution()
void rotate ( out ReturnCode  aReturnCode,
int  aAngle,
int  aBackgroundColor 
)

Rotate the image.

If the image has 1 bit per pixel, aAngle must be an integer multiple of 90.

The resolution of the image is adjusted only if aAngle is an even integer multiple of 90.

This function fails exception if aAngle is not an integer multiple of 90, the image uses a palette, and aBackgroundColor is not a color in the palette.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aAngleRotation angle (degrees), positive for counter-clockwise, negative for clockwise.
[in]aBackgroundColorThe RGB color (0x00rrggbb) to be used for filling pixels that are not mapped from the source image. This value is used only if aAngle is not an integer multiple of 90.
See also
crop(), mirrorX(), mirrorY(), resizeToResolution()
void saveToFile ( out ReturnCode  aReturnCode,
string  aPath,
SignDocImageParameters  aParameters 
)

Save this image to a file.

The following parameters of aParameters are used:

  • BitsPerComponent (integer)
  • BlackIsZero (boolean)
  • BottomUp (boolean)
  • Components (integer)
  • Compression (string)
  • Format (string)
  • OverrideResolution (integer)
  • Padding (integer)
  • PixelFormat (string)
  • WhiteIsZero (boolean)
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPathThe pathname of the file to be created or overwritten.
[in]aParametersParameters controlling the format of the blob.
See also
loadFromFile(), saveToFile2(), saveToMemory()
void saveToFile2 ( out ReturnCode  aReturnCode,
string  aPath,
string  aFormat 
)

Save this image to a file.

This is a simplified version of saveToFile().

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPathThe pathname of the file to be created or overwritten.
[in]aFormatThe format to be used for the image file:
  • "auto": derive the format from the suffix of aPath
  • "bmp": Windows bitmap
  • "gif": GIF
  • "png": PNG
  • "tiff": TIFF; CCITT Group 4 compression is used for images with 1 bit per pixel, LZW compression is used otherwise.
See also
loadFromFile(), saveToFile(), saveToMemory2()
byte [] saveToMemory ( out ReturnCode  aReturnCode,
SignDocImageParameters  aParameters 
)

Save this image as a blob.

The following parameters of aParameters are used:

  • BitsPerComponent (integer)
  • BlackIsZero (boolean)
  • BottomUp (boolean)
  • Components (integer)
  • Compression (string)
  • Format (string)
  • OverrideResolution (integer)
  • Padding (integer)
  • PixelFormat (string)
  • WhiteIsZero (boolean)
Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aParametersParameters controlling the format of the blob.
Returns
The blob.
See also
loadFromMemory(), saveToFile(), saveToMemory2()
byte [] saveToMemory2 ( out ReturnCode  aReturnCode,
string  aFormat 
)

Save this image as a blob.

This is a simplified version of saveToMemory().

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFormatThe format to be used for the image blob:
  • "bmp": Windows bitmap
  • "gif": GIF
  • "png": PNG
  • "tiff": TIFF; CCITT Group 4 compression is used for images with 1 bit per pixel, LZW compression is used otherwise.
Returns
The blob.
See also
loadFromMemory(), saveToFile2(), saveToMemory()
void setEmpty ( out ReturnCode  aReturnCode,
int  aWidth,
int  aHeight,
int  aBitsPerPixel,
int  aColor 
)

Replace this image with an empty one of the specified size.

The resolution will be set to 72 dots per inch.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aWidthThe width of the image (in pixels). Must be positive.
[in]aHeightThe height of the image (in pixels). Must be positive.
[in]aBitsPerPixelNumber of bits per pixel: 1 (bi-level black and white), 8 (grayscale), or 24 (RGB).
[in]aColorAll pixels will be set to this color. If aBitsPerPixel is 24, this is an RGB color (0x00rrggbb), otherwise this is an index into the palette (0 is black).
See also
clear(), setPaletteAt(), setResolution()
void setPaletteAt ( out ReturnCode  aReturnCode,
int  aIndex,
int  aColor 
)

Set a palette entry.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aIndexThe 0-based index of the palette entry (0 through 1 if getBitsPerPixel() returns 1, 0 through 255 if getBitsPerPixel() returns 8).
[in]aColorThe new color for the palette entry (0x00rrggbb).
See also
getBitsPerPixel(), getPalette()
void setPixelRGB ( out ReturnCode  aReturnCode,
int  aX,
int  aY,
int  aColor 
)

Set the RGB color of a pixel.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aXX coordinate.
[in]aYY coordinate.
[in]aColorThe new RGB color (0x00rrggbb) of the pixel. This function fails if the color does not exist in the palette of an indexed image.
See also
drawLine(), drawRect(), getPixelRGB(), setPixelValue()
void setPixelValue ( out ReturnCode  aReturnCode,
int  aX,
int  aY,
int  aValue 
)

Set the value of a pixel.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aXX coordinate.
[in]aYY coordinate.
[in]aValueThe new value of the pixel. If getBitsPerPixel() returns 1 or 8, this is the index into the palette, if getBitsPerPixel() returns 24, this is the RGB color (0x00rrggbb). For bi-level images, any value greater than 1 has the same effect as 1.
See also
getPixelValue()
void setResolution ( out ReturnCode  aReturnCode,
int  aResolutionX,
int  aResolutionY 
)

Set the resolution of the image.

This function does not modify the pixels of the image. Use resizeToResolution() to change the size of the image.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aResolutionXThe new horizontal resolution of the image in DPI. Must be positive.
[in]aResolutionYThe new vertical resolution of the image in DPI. Must be positive.
See also
getResolutionX(), getResolutionY(), resizeToResolution()

The documentation for this class was generated from the following file: