Home > front end >  Signature plugin jsignature sign board how to determine whether any signature.
Signature plugin jsignature sign board how to determine whether any signature.

Time:10-27

I convert this signature to base/64 PNG images, if I didn't sign it will generate a blank picture, how do I need to know whether have sign,



Online etc.!!!!!! Be urgent!!!!!!

CodePudding user response:

Get canvas graphics data, context. GetImageData (x, y, width, height),
This method returns an ImageData object, the object is mainly has three attributes:
ImageData. Width: how many in a row element
ImageData. Height: how much per column element
ImageData. Data: one dimensional array, store the retrieved from the canvas RGBA values of each pixel, the array for each pixel preserved the four values - red, green, blue and alpha transparency, each value between 0 to 255, as a result, the canvas of each pixel in the array becomes a four integer values, and an array of filling the order from left to right, from top to bottom,

Determine pixel values are 255 is completely blank, how can ask a white pixel values in order to be effective

CodePudding user response:

The building Lord found the method? I'm stuck in this place, to solve the thank you!

CodePudding user response:

refer to the second floor qq_29135897 response:
I found the way? I'm stuck in this place, to solve the thank you!

There are ways of, oneself see API
$(' # XXX). JSignature (' getData ', 'native'). Length

==="check jSignature for signature data

CodePudding user response:

SignaturePad. IsEmpty (); Determine whether empty
https://github.com/szimek/signature_pad
The plug-in configuration items, option, written API method is full, and now also in the update maintenance, a signed plug-in is better.

CodePudding user response:

If ($(" # signature "). JSignature (' getData ', 'native'). Length==0) {
Alert (" please sign ");
return;
}
  • Related