File tree Expand file tree Collapse file tree 8 files changed +28
-5
lines changed Expand file tree Collapse file tree 8 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,11 @@ var frame = require("ui/frame");
31
31
function getDrawing (args ) {
32
32
// get reference to the drawing pad
33
33
var pad = frame .topmost ().currentPage .getViewById (" drawingPad" );
34
- // then access the 'drawing' property of the signaturepad;
34
+ // then access the 'drawing' property (Bitmap on Android) of the signaturepad
35
35
var drawingImage = pad .drawing ;
36
+
37
+ // If you want to clear the signature/drawing...
38
+ pad .clearDrawing ();
36
39
}
37
40
exports .getDrawing = getDrawing;
38
41
```
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ function padLoaded(args) {
23
23
}
24
24
exports . padLoaded = padLoaded ;
25
25
26
-
27
26
function getDrawing ( args ) {
28
27
var pad = frame . topmost ( ) . currentPage . getViewById ( "drawingPad" ) ;
29
28
var pic = pad . drawing ;
@@ -33,6 +32,6 @@ exports.getDrawing = getDrawing;
33
32
34
33
function clearDrawing ( args ) {
35
34
var pad = frame . topmost ( ) . currentPage . getViewById ( "drawingPad" ) ;
36
- pad . clear ( ) ;
35
+ pad . clearDrawing ( ) ;
37
36
}
38
37
exports . clearDrawing = clearDrawing ;
Original file line number Diff line number Diff line change 18
18
penWidth =" 3" />
19
19
20
20
<Button text =" Get Drawing" tap =" getDrawing" />
21
- <!-- < button text="Clear Drawing" tap="clearDrawing" /> -- >
21
+ <button text =" Clear Drawing" tap =" clearDrawing" />
22
22
</StackLayout >
23
23
</ScrollView >
24
24
</Page >
Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ var SignaturePad = (function (_super) {
44
44
enumerable : true ,
45
45
configurable : true
46
46
} ) ;
47
+ SignaturePad . prototype . clearDrawing = function ( ) {
48
+ try {
49
+ this . _android . clear ( ) ;
50
+ }
51
+ catch ( ex ) {
52
+ console . log ( "Error clearing the pad: " + ex ) ;
53
+ }
54
+ } ;
47
55
return SignaturePad ;
48
56
} ) ( common . SignaturePad ) ;
49
57
exports . SignaturePad = SignaturePad ;
Original file line number Diff line number Diff line change @@ -34,4 +34,12 @@ export class SignaturePad extends common.SignaturePad {
34
34
}
35
35
}
36
36
37
+ public clearDrawing ( ) {
38
+ try {
39
+ this . _android . clear ( ) ;
40
+ } catch ( ex ) {
41
+ console . log ( "Error clearing the pad: " + ex ) ;
42
+ }
43
+ }
44
+
37
45
}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ declare module "signaturepad" {
9
9
/**
10
10
* Represents a Signature Pad (drawing pad) component.
11
11
*/
12
- export class Video extends view . View {
12
+ export class SignaturePad extends view . View {
13
13
public static penColorProperty : dependencyObservable . Property ;
14
14
public static penWidthProperty : dependencyObservable . Property ;
15
15
@@ -37,6 +37,11 @@ declare module "signaturepad" {
37
37
* Gets or set the stroke width attribute
38
38
*/
39
39
penWidth : any ;
40
+
41
+ /*
42
+ * Use this to clear/erase the pad
43
+ */
44
+ clearDrawing : Function ;
40
45
}
41
46
42
47
/**
You can’t perform that action at this time.
0 commit comments