GraffitiSignature

Enumerations #

Name Values
This class exposes no enumerations.

Constants #

Name Type Value
This class exposes no constants.

Events #

Definition Description
SignatureChanged() Fired when the user release the mouse button or raises their finger from the screen.

Methods #

Definition Description
Load(ImageData as String) Loads a signature image from fully-qualified, base64-encoded data. Must include the “data:image/png;base64,” header included with output.
Clear() Clears the canvas for a new signature.

Properties #

Name Type Default Value Description
PenColor Color &c000000 Determines the color used in the handwriting.
SignatureData String “” BASE64 data of the signature image currently being displayed.
SignatureImage Picture Nil Signature Image currently being displayed.

Examples #

Converting to JPEG or other format that doesn’t support alpha channels #

GraffitiSignature returns PNG-formatted data where the actual drawing is placed in a transparent layer. Due to this, if you try to convert directly to a JPEG or other format that doesn’t support alpha channels, you’ll end up with the drawing on a black background. Unless you’ve changed the PenColor, you’ll end up with a black signature on a black background. The following code in the SignatureChanged event will create a non-transparent version of the signature:

var pToJPEG as new Picture( me.SignatureImage.Width, me.SignatureImage.Height )
var g as Graphics = pToJPEG.Graphics
 
g.DrawingColor = &cFFFFFF
g.FillRectangle( 0, 0, g.Width, g.Height )
 
g.DrawPicture( me.SignatureImage, 0, 0 )
 
var dataJPEG as String = pToJPEG.ToData(Picture.Formats.JPEG, 50)