# Signature

This class represents a parsed signature from a Scriptel ScripTouch EasyScript device.

package | Application

### Methods

## Constructor, creates a new instance of Signature class.

    __construct(\com\scriptel\SignatureMetaDatasignatureMetaData, \com\scriptel\Coordinate[][]strokes) : mixed

### Arguments

#### signatureMetaData

`\com\scriptel\SignatureMetaData`

All of the non-signature related data.

#### strokes

`\com\scriptel\Coordinate[][]`

List of strokes containing coordinates.

### Response

`mixed`

## This method crops the signature to fit within the smallest space possible.

    crop() : mixed

### Response

`mixed`

## This method gets the bounding box surrounding the signature stored within this object.

    getBounds() : \com\scriptel\BoundingBox

### Response

`\com\scriptel\BoundingBox`

The bounding box surrounding the signature.

## This method should return the height of the signature in pixels.

    getHeight() : int

### Response

`int`

## This method renders the signature stored in this object as a PNG using GD.

    getImagePng(intscale = 1, intlineThickness = 1, int[]foreColor = array(0, 0, 0, 0), int[]backColor = array(0xff, 0xff, 0xff, 127), stringfileName = false) : mixed

### Arguments

#### scale

`int`

Scale Scale by which to scale the signature up or down in size.

#### lineThickness

`int`

The thickness of the resulting line. This is scaled up and down with scale.

#### foreColor

`int[]`

A four index array containing the color of the foreground color in red, green, blue, alpha format.

#### backColor

`int[]`

A four index array containing the coolor of the background color in red, green, blue, alpha format.

#### fileName

`string`

The file name to save this image as, if omitted it will be printed.

### Response

`mixed`

## The model number of the device used to create the string.

    getModel() : string

### Response

`string`

Model number.

## Gets the protocol version used to generate the EasyScript string.

    getProtocolVersion() : string

### Response

`string`

Protocol version.

## Gets the metadata associated with this signature.

    getSignatureMetaData() : \com\scriptel\SignatureMetaData

### Response

`\com\scriptel\SignatureMetaData`

Metadata associated with this signature.

## List of strokes containing lists of points that make up the encoded signature.

    getStrokes() : \com\scriptel\Coordinate[][]

### Response

`\com\scriptel\Coordinate[][]`

List of strokes.

## The firmware version of the device used to create the string.

    getVersion() : string

### Response

`string`

Firmware version.

## This method should return the width of the signature in pixels.

    getWidth() : int

### Response

`int`

## This method sets the height of the signature in pixels.

    setHeight(mixedheight) : mixed

### Arguments

#### height

`mixed`

### Response

`mixed`

## This method sets the width of the signature in pixels.

    setWidth(mixedwidth) : mixed

### Arguments

#### width

`mixed`

### Response

`mixed`

### Properties

## The captured protocol version. At present A, B, C, D and E exist.

    protocolVersion : string

var |

### Type(s)

`string`

## The model of the device that captured the signature.

    model : string

var |

### Type(s)

`string`

## The currently running version of the firmware on the device that captured the signature.

    version : string

var |

### Type(s)

`string`

## An array of coordinate arrays containing the pen strokes parsed from the signature stream.

    strokes : \com\scriptel\Coordinate[][]

var |

### Type(s)

`array<string|int, array<string|int, Coordinate>>`

## The current used signature protocol (STNSignatureProtocol).

    signatureProtocol : \com\scriptel\SignatureProtocol

var |

### Type(s)

`SignatureProtocol`

## The width of the device's display in pixels.

    width : int

var |

### Type(s)

`int`

## The height of the device's display in pixels.

    height : int

var |

### Type(s)

`int`