Method StartSignatureMode
StartSignatureMode(SignMode)
Starts a signature process.
Declaration
Error StartSignatureMode(SignMode mode)
Parameters
Type | Name | Description |
---|---|---|
SignMode | mode | Which kind of signature mode to start. |
Returns
Type | Description |
---|---|
Error | Error |
Remarks
Please note that you may want to set a signature rectangle before with SetSignatureRectangle(Int32, Int32, Int32, Int32, Object) or SetSignatureRectangle(Int32, Int32, Int32, Int32, Int32, Int32, SignRectOption, SignRectScrollCorrect).
Examples
The following example starts the standard signature mode with a signature rectangle in the lower left corner of the display.
int width = 400;
int height = 200;
int displayHeight = driver.DeviceProperties.Hardware.DisplayHeight;
Error r = driver.SetSignatureRectangle(0, displayHeight - height, width, height);
if (Error.SUCCESS != driver.StartSignatureMode(SignMode.StandardSign))
{
// something is wrong
return;
}
Console.WriteLine("Start signing, please.");
bool finished = false;
driver.SignFinished += (object sender, EventArgs e) =>
{
Console.WriteLine("Drawing has stopped.");
finished = true;
};
while (!finished)
Thread.Sleep(500);
r = driver.StopSignatureCapture();
The following example starts a document signature process in portrait mode with a background image read from a file. Whether the device supports portrait mode support can be queried with DeviceProperties.IFeatures.PortraitModeSupport. The signature rectangle is scrolled together with the background image to the top row of the screen. Please note that in DEG_270 orientation the top row is at the right edge of the device.
Then, thread waits until the SignFinished event is raised and stops the signature capture.
C#
Bitmap page = new Bitmap("pageToBeSigned.bmp");
driver.DeviceProperties.Status.DisplayOrientation = DisplayOrientation.DEG_270;
Error r = driver.SetSignBackground(page);
int width = 400;
int height = 200;
r = driver.SetSignatureRectangle(0, 0, width, height, 0, height, SignRectOption.ScrollXY);
if (Error.SUCCESS != driver.StartSignatureMode(SignMode.DocumentSign))
{
// something is wrong
return;
}
Console.WriteLine("Start signing, please.");
bool finished = false;
driver.SignFinished += (object sender, EventArgs e) =>
{
Console.WriteLine("Drawing has stopped.");
finished = true;
};
while (!finished)
Thread.Sleep(500);
r = driver.StopSignatureCapture();