├── .editorconfig
├── .gitignore
├── ISSUE_TEMPLATE.md
├── LICENSE
├── README.md
├── build.cake
├── build.ps1
├── build.sh
├── images
├── gradient.png
├── signature-ios.jpg
├── signature-pad-glyph.png
├── signature-pad-glyph.svg
├── signature-pad.png
├── signature-pad.svg
├── signature-pad_1024x1024.png
├── signature-pad_128x128.png
├── signature-pad_256x256.png
└── signature-pad_512x512.png
├── nuget
├── Xamarin.Controls.SignaturePad.Forms.nuspec
└── Xamarin.Controls.SignaturePad.nuspec
├── samples
├── Sample.Android
│ ├── MainActivity.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── drawable-hdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-ldpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-xhdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-xxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable
│ │ │ ├── background.xml
│ │ │ └── ic_launcher.png
│ │ ├── layout
│ │ │ └── main.axml
│ │ └── values
│ │ │ └── strings.xml
│ ├── Sample.Android.csproj
│ └── Sample.Android.sln
├── Sample.Forms
│ ├── Sample.Forms.Mac.sln
│ ├── Sample.Forms.sln
│ ├── Samples.Android
│ │ ├── MainActivity.cs
│ │ ├── Properties
│ │ │ ├── AndroidManifest.xml
│ │ │ └── AssemblyInfo.cs
│ │ ├── Resources
│ │ │ ├── drawable-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-ldpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable
│ │ │ │ └── ic_launcher.png
│ │ │ ├── layout
│ │ │ │ ├── tabs.xml
│ │ │ │ └── toolbar.xml
│ │ │ ├── values-v21
│ │ │ │ └── style.xml
│ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── style.xml
│ │ └── Samples.Android.csproj
│ ├── Samples.UWP
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Assets
│ │ │ ├── LargeTile.scale-100.png
│ │ │ ├── LargeTile.scale-125.png
│ │ │ ├── LargeTile.scale-150.png
│ │ │ ├── LargeTile.scale-200.png
│ │ │ ├── LargeTile.scale-400.png
│ │ │ ├── SmallTile.scale-100.png
│ │ │ ├── SmallTile.scale-125.png
│ │ │ ├── SmallTile.scale-150.png
│ │ │ ├── SmallTile.scale-200.png
│ │ │ ├── SmallTile.scale-400.png
│ │ │ ├── SplashScreen.scale-100.png
│ │ │ ├── SplashScreen.scale-125.png
│ │ │ ├── SplashScreen.scale-150.png
│ │ │ ├── SplashScreen.scale-200.png
│ │ │ ├── SplashScreen.scale-400.png
│ │ │ ├── Square150x150Logo.scale-100.png
│ │ │ ├── Square150x150Logo.scale-125.png
│ │ │ ├── Square150x150Logo.scale-150.png
│ │ │ ├── Square150x150Logo.scale-200.png
│ │ │ ├── Square150x150Logo.scale-400.png
│ │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ │ │ ├── Square44x44Logo.altform-unplated_targetsize-24.png
│ │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png
│ │ │ ├── Square44x44Logo.altform-unplated_targetsize-32.png
│ │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ │ │ ├── Square44x44Logo.scale-100.png
│ │ │ ├── Square44x44Logo.scale-125.png
│ │ │ ├── Square44x44Logo.scale-150.png
│ │ │ ├── Square44x44Logo.scale-200.png
│ │ │ ├── Square44x44Logo.scale-400.png
│ │ │ ├── Square44x44Logo.targetsize-16.png
│ │ │ ├── Square44x44Logo.targetsize-24.png
│ │ │ ├── Square44x44Logo.targetsize-256.png
│ │ │ ├── Square44x44Logo.targetsize-32.png
│ │ │ ├── Square44x44Logo.targetsize-48.png
│ │ │ ├── StoreLogo.scale-100.png
│ │ │ ├── StoreLogo.scale-125.png
│ │ │ ├── StoreLogo.scale-150.png
│ │ │ ├── StoreLogo.scale-200.png
│ │ │ ├── StoreLogo.scale-400.png
│ │ │ ├── Wide310x150Logo.scale-100.png
│ │ │ ├── Wide310x150Logo.scale-125.png
│ │ │ ├── Wide310x150Logo.scale-150.png
│ │ │ ├── Wide310x150Logo.scale-200.png
│ │ │ └── Wide310x150Logo.scale-400.png
│ │ ├── MainPage.xaml
│ │ ├── MainPage.xaml.cs
│ │ ├── Package.appxmanifest
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── Default.rd.xml
│ │ ├── Samples.UWP.csproj
│ │ └── Samples.UWP_TemporaryKey.pfx
│ ├── Samples.iOS
│ │ ├── AppDelegate.cs
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ ├── Main.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Resources
│ │ │ ├── Assets.xcassets
│ │ │ │ └── AppIcons.appiconset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ │ └── ItunesArtwork@2x.png
│ │ │ ├── gradient.png
│ │ │ └── signature-pad-glyph.png
│ │ └── Samples.iOS.csproj
│ └── Samples
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── BindingPage.xaml
│ │ ├── BindingPage.xaml.cs
│ │ ├── BindingPageViewModel.cs
│ │ ├── EventsPage.xaml
│ │ ├── EventsPage.xaml.cs
│ │ ├── Helpers
│ │ ├── CaptureSignatureBehaviorBase.cs
│ │ ├── CaptureSignaturePointsBehavior.cs
│ │ ├── CaptureSignatureStrokesBehavior.cs
│ │ └── NotConverter.cs
│ │ ├── MainPage.xaml
│ │ ├── MainPage.xaml.cs
│ │ └── Samples.csproj
├── Sample.UWP
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Assets
│ │ ├── LargeTile.scale-100.png
│ │ ├── LargeTile.scale-125.png
│ │ ├── LargeTile.scale-150.png
│ │ ├── LargeTile.scale-200.png
│ │ ├── LargeTile.scale-400.png
│ │ ├── SmallTile.scale-100.png
│ │ ├── SmallTile.scale-125.png
│ │ ├── SmallTile.scale-150.png
│ │ ├── SmallTile.scale-200.png
│ │ ├── SmallTile.scale-400.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-125.png
│ │ ├── SplashScreen.scale-150.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── SplashScreen.scale-400.png
│ │ ├── Square150x150Logo.scale-100.png
│ │ ├── Square150x150Logo.scale-125.png
│ │ ├── Square150x150Logo.scale-150.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-400.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-24.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-32.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-125.png
│ │ ├── Square44x44Logo.scale-150.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-400.png
│ │ ├── Square44x44Logo.targetsize-16.png
│ │ ├── Square44x44Logo.targetsize-24.png
│ │ ├── Square44x44Logo.targetsize-256.png
│ │ ├── Square44x44Logo.targetsize-32.png
│ │ ├── Square44x44Logo.targetsize-48.png
│ │ ├── StoreLogo.scale-100.png
│ │ ├── StoreLogo.scale-125.png
│ │ ├── StoreLogo.scale-150.png
│ │ ├── StoreLogo.scale-200.png
│ │ ├── StoreLogo.scale-400.png
│ │ ├── Wide310x150Logo.scale-100.png
│ │ ├── Wide310x150Logo.scale-125.png
│ │ ├── Wide310x150Logo.scale-150.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ └── Wide310x150Logo.scale-400.png
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ ├── Sample.UWP.csproj
│ ├── Sample.UWP.sln
│ └── Sample.UWP_TemporaryKey.pfx
└── Sample.iOS
│ ├── AppDelegate.cs
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── LaunchScreen.storyboard
│ ├── Main.cs
│ ├── Main.storyboard
│ ├── Resources
│ ├── Assets.xcassets
│ │ └── AppIcons.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── ItunesArtwork@2x.png
│ ├── gradient.png
│ └── signature-pad-glyph.png
│ ├── Sample.iOS.csproj
│ ├── Sample.iOS.sln
│ ├── ViewController.cs
│ ├── ViewController.designer.cs
│ ├── iTunesArtwork
│ └── iTunesArtwork@2x
├── src
├── SignaturePad.Android
│ ├── InkPresenter.cs
│ ├── Resources
│ │ ├── drawable
│ │ │ └── signature_pad_background.xml
│ │ ├── layout
│ │ │ └── signature_pad_layout.axml
│ │ └── values
│ │ │ ├── attrs.xml
│ │ │ └── signature_pad_defaults.xml
│ ├── SignaturePad.Android.csproj
│ ├── SignaturePadCanvasView.cs
│ └── SignaturePadView.cs
├── SignaturePad.Forms.Droid
│ ├── SignaturePad.Forms.Droid.csproj
│ └── SignaturePadViewRenderer.cs
├── SignaturePad.Forms.Platform.Shared
│ ├── ColorExtensions.cs
│ └── SignaturePadCanvasRenderer.cs
├── SignaturePad.Forms.Shared
│ ├── ImageConstructionSettings.cs
│ ├── SignatureImageFormat.cs
│ ├── SignaturePadCanvasView.cs
│ └── SignaturePadView.cs
├── SignaturePad.Forms.UWP
│ └── SignaturePad.Forms.UWP.csproj
├── SignaturePad.Forms.iOS
│ └── SignaturePad.Forms.iOS.csproj
├── SignaturePad.Forms
│ ├── SignaturePad.Forms.csproj
│ └── SignaturePadCanvasRenderer.cs
├── SignaturePad.InkPresenter.Shared
│ ├── InkPresenter.cs
│ └── InkStroke.cs
├── SignaturePad.Mac.sln
├── SignaturePad.Shared
│ ├── Extensions.cs
│ ├── ImageConstructionSettings.cs
│ ├── PathSmoothing.cs
│ ├── SignatureImageFormat.cs
│ ├── SignaturePadCanvasView.cs
│ └── SignaturePadView.cs
├── SignaturePad.UWP
│ ├── SignaturePad.UWP.csproj
│ ├── SignaturePad.cs
│ ├── SignaturePadCanvasView.cs
│ └── Themes
│ │ └── Generic.xaml
├── SignaturePad.iOS
│ ├── InkPresenter.cs
│ ├── SignaturePad.iOS.csproj
│ ├── SignaturePadCanvasView.cs
│ └── SignaturePadView.cs
└── SignaturePad.sln
└── tools
└── packages.config
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Description
2 |
3 |
4 |
5 | ### Code
6 |
7 |
8 |
9 | ### Expected Behavior
10 |
11 |
12 |
13 | ### Actual Behavior
14 |
15 |
16 |
17 | ### Basic Information
18 |
19 | - Version with issue:
20 | - Last known good version:
21 | - IDE:
22 | - Platform Target Frameworks:
23 | - Android:
24 | - iOS:
25 | - UWP:
26 | - Xamarin.Forms:
27 | - Target Devices:
28 | -
29 |
30 | ### Screenshots
31 |
32 |
33 |
34 | ### Reproduction Link
35 |
36 |
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Xamarin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Signature Pad
2 |
3 |
4 | [](https://jenkins.mono-project.com/view/Components/job/Components-SignaturePad-Windows/) [](https://jenkins.mono-project.com/view/Components/job/Components-SignaturePad/)
5 |
6 | [](https://www.nuget.org/packages/Xamarin.Controls.SignaturePad) [](https://www.nuget.org/packages/Xamarin.Controls.SignaturePad.Forms)
7 |
8 | Signature Pad makes capturing, saving, exporting, and displaying signatures extremely simple on
9 | Xamarin.iOS, Xamarin.Android and Windows.
10 |
11 | Not only is Signature Pad available for native apps, but also available in Xamarin.Forms apps.
12 |
13 | 
14 |
15 | ---
16 |
17 | ## Using Signature Pad
18 |
19 | Signature Pad can be installed from [NuGet.org][nuget-link] for native Xamarin and Windows apps:
20 |
21 | ```
22 | nuget install Xamarin.Controls.SignaturePad
23 | ```
24 |
25 | And also for Xamarin.Forms apps:
26 |
27 | ```
28 | nuget install Xamarin.Controls.SignaturePad.Forms
29 | ```
30 |
31 | ### Using Signature Pad on iOS
32 |
33 | ```csharp
34 | using Xamarin.Controls;
35 |
36 | var signatureView = new SignaturePadView (View.Frame) {
37 | StrokeWidth = 3f,
38 | StrokeColor = UIColor.Black,
39 | BackgroundColor = UIColor.White,
40 | };
41 | ```
42 |
43 | ### Using Signature Pad on Android
44 |
45 | ```csharp
46 | using Xamarin.Controls;
47 |
48 | var signatureView = new SignaturePadView (this) {
49 | StrokeWidth = 3f,
50 | StrokeColor = Color.White,
51 | BackgroundColor = Color.Black
52 | };
53 | ```
54 |
55 | ### Using Signature Pad on Windows
56 |
57 | ```xml
58 |
59 |
60 |
65 | ```
66 |
67 | ### Using Signature Pad on Xamarin.Forms
68 |
69 | ```xml
70 |
71 |
72 |
77 | ```
78 |
79 | ### Obtaining a Signature Image
80 |
81 | The signature that was drawn on the canvas can be obtained as a image using the `GetImage(...)`
82 | method overloads. The resulting image will be in the native platform image type:
83 |
84 | ```csharp
85 | // iOS
86 | UIImage image = signatureView.GetImage ();
87 |
88 | // Android
89 | Bitmap image = signatureView.GetImage ();
90 |
91 | // Windows
92 | WriteableBitmap bitmap = signatureView.GetImage ();
93 | ```
94 |
95 | For Xamarin.Forms, there is no "native" image format, but `GetImageStreamAsync` can be used instead
96 | to retrieve an encoded (jpeg or png) image stream:
97 |
98 | ```csharp
99 | Stream bitmap = await signatureView.GetImageStreamAsync (SignatureImageFormat.Png);
100 | ```
101 |
102 | ### Obtaining the Signature Points
103 |
104 | In addition to retrieving the signature as an image, the signature can also be retrieved as
105 | as an array of points:
106 |
107 | ```csharp
108 | var strokes = signatureView.Strokes;
109 | ```
110 |
111 | These strokes can be used to save and restore a signature:
112 |
113 | ```csharp
114 | // restore strokes (iOS, Android, Windows)
115 | signatureView.LoadStrokes (newStrokes);
116 |
117 | // restore strokes (Xamarin.Forms)
118 | signatureView.Strokes = newStrokes;
119 | ```
120 |
121 | ---
122 |
123 | ## License
124 |
125 | The license for this repository is specified in [LICENSE](LICENSE).
126 |
127 |
128 | ## .NET Foundation
129 | This project is part of the [.NET Foundation](http://www.dotnetfoundation.org/projects).
130 |
131 | [nuget-link]: https://www.nuget.org/packages/Xamarin.Controls.SignaturePad
132 |
--------------------------------------------------------------------------------
/build.cake:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////
2 | // ARGUMENTS
3 | ///////////////////////////////////////////////////////////////////////////////
4 |
5 | var CURRENT_PACKAGE_VERSION = "3.0.0";
6 |
7 | var target = Argument("target", "Default");
8 | var configuration = Argument("configuration", "Release");
9 | var packageVersion = Argument("packageVersion", CURRENT_PACKAGE_VERSION);
10 | var majorVersion = $"{packageVersion.Substring(0, packageVersion.IndexOf("."))}.0.0.0";
11 | var buildVersion = Argument("buildVersion", EnvironmentVariable("BUILD_NUMBER") ?? "");
12 | if (!string.IsNullOrEmpty(buildVersion)) {
13 | buildVersion = $"-{buildVersion}";
14 | }
15 |
16 | ///////////////////////////////////////////////////////////////////////////////
17 | // TASKS
18 | ///////////////////////////////////////////////////////////////////////////////
19 |
20 | Task("libs")
21 | .Does(() =>
22 | {
23 | var sln = IsRunningOnWindows() ? "./src/SignaturePad.sln" : "./src/SignaturePad.Mac.sln";
24 |
25 | MSBuild(sln, new MSBuildSettings {
26 | Verbosity = Verbosity.Minimal,
27 | Configuration = configuration,
28 | PlatformTarget = PlatformTarget.MSIL,
29 | MSBuildPlatform = MSBuildPlatform.x86,
30 | ArgumentCustomization = args => args.Append("/restore"),
31 | Properties = {
32 | { "AssemblyVersion", new [] { majorVersion } },
33 | { "Version", new [] { packageVersion } },
34 | },
35 | });
36 |
37 | EnsureDirectoryExists("./output/android/");
38 | EnsureDirectoryExists("./output/ios/");
39 | EnsureDirectoryExists("./output/uwp/");
40 | EnsureDirectoryExists("./output/uwp/Themes");
41 | EnsureDirectoryExists("./output/netstandard/");
42 |
43 | CopyFiles($"./src/SignaturePad.Android/bin/{configuration}/SignaturePad.*", "./output/android/");
44 | CopyFiles($"./src/SignaturePad.iOS/bin/{configuration}/SignaturePad.*", "./output/ios/");
45 | CopyFiles($"./src/SignaturePad.UWP/bin/{configuration}/SignaturePad.*", "./output/uwp/");
46 | CopyFiles($"./src/SignaturePad.UWP/bin/{configuration}/Themes/*", "./output/uwp/Themes");
47 |
48 | CopyFiles($"./src/SignaturePad.Forms.Droid/bin/{configuration}/SignaturePad.Forms.*", "./output/android/");
49 | CopyFiles($"./src/SignaturePad.Forms.iOS/bin/{configuration}/SignaturePad.Forms.*", "./output/ios/");
50 | CopyFiles($"./src/SignaturePad.Forms.UWP/bin/{configuration}/SignaturePad.Forms.*", "./output/uwp/");
51 | CopyFiles($"./src/SignaturePad.Forms.UWP/bin/{configuration}/Themes/*", "./output/uwp/Themes");
52 | CopyFiles($"./src/SignaturePad.Forms/bin/{configuration}/SignaturePad.Forms.*", "./output/netstandard/");
53 | });
54 |
55 | Task("nuget")
56 | .IsDependentOn("libs")
57 | .WithCriteria(IsRunningOnWindows())
58 | .Does(() =>
59 | {
60 | var nuget = Context.Tools.Resolve("nuget.exe");
61 | var nuspecs = GetFiles("./nuget/*.nuspec");
62 | var settings = new NuGetPackSettings {
63 | BasePath = ".",
64 | OutputDirectory = "./output",
65 | Properties = new Dictionary {
66 | { "configuration", configuration },
67 | { "version", packageVersion },
68 | },
69 | };
70 |
71 | EnsureDirectoryExists("./output");
72 |
73 | NuGetPack(nuspecs, settings);
74 |
75 | settings.Properties["version"] = $"{packageVersion}-preview{buildVersion}";
76 | NuGetPack(nuspecs, settings);
77 | });
78 |
79 | Task("samples")
80 | .IsDependentOn("libs")
81 | .Does(() =>
82 | {
83 | var settings = new MSBuildSettings {
84 | Verbosity = Verbosity.Minimal,
85 | Configuration = configuration,
86 | PlatformTarget = PlatformTarget.MSIL,
87 | MSBuildPlatform = MSBuildPlatform.x86,
88 | ArgumentCustomization = args => args.Append("/restore"),
89 | };
90 |
91 | if (IsRunningOnWindows()) {
92 | MSBuild("./samples/Sample.Android/Sample.Android.sln", settings);
93 | MSBuild("./samples/Sample.iOS/Sample.iOS.sln", settings);
94 | MSBuild("./samples/Sample.UWP/Sample.UWP.sln", settings);
95 | MSBuild("./samples/Sample.Forms/Sample.Forms.sln", settings);
96 | } else {
97 | MSBuild("./samples/Sample.Android/Sample.Android.sln", settings);
98 | MSBuild("./samples/Sample.iOS/Sample.iOS.sln", settings);
99 | MSBuild("./samples/Sample.Forms/Sample.Forms.Mac.sln", settings);
100 | }
101 |
102 | });
103 |
104 | Task("Default")
105 | .IsDependentOn("libs")
106 | .IsDependentOn("nuget")
107 | .IsDependentOn("samples");
108 |
109 | Task("CI")
110 | .IsDependentOn("Default");
111 |
112 | RunTarget(target);
113 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##########################################################################
4 | # This is the Cake bootstrapper script for Linux and OS X.
5 | # This file was downloaded from https://github.com/cake-build/resources
6 | # Feel free to change this file to fit your needs.
7 | ##########################################################################
8 |
9 | # Define directories.
10 | SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
11 | TOOLS_DIR=$SCRIPT_DIR/tools
12 | ADDINS_DIR=$TOOLS_DIR/Addins
13 | MODULES_DIR=$TOOLS_DIR/Modules
14 | NUGET_EXE=$TOOLS_DIR/nuget.exe
15 | CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe
16 | PACKAGES_CONFIG=$TOOLS_DIR/packages.config
17 | PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum
18 | ADDINS_PACKAGES_CONFIG=$ADDINS_DIR/packages.config
19 | MODULES_PACKAGES_CONFIG=$MODULES_DIR/packages.config
20 |
21 | # Define md5sum or md5 depending on Linux/OSX
22 | MD5_EXE=
23 | if [[ "$(uname -s)" == "Darwin" ]]; then
24 | MD5_EXE="md5 -r"
25 | else
26 | MD5_EXE="md5sum"
27 | fi
28 |
29 | # Define default arguments.
30 | SCRIPT="build.cake"
31 | CAKE_ARGUMENTS=()
32 |
33 | # Parse arguments.
34 | for i in "$@"; do
35 | case $1 in
36 | -s|--script) SCRIPT="$2"; shift ;;
37 | --) shift; CAKE_ARGUMENTS+=("$@"); break ;;
38 | *) CAKE_ARGUMENTS+=("$1") ;;
39 | esac
40 | shift
41 | done
42 |
43 | # Make sure the tools folder exist.
44 | if [ ! -d "$TOOLS_DIR" ]; then
45 | mkdir "$TOOLS_DIR"
46 | fi
47 |
48 | # Make sure that packages.config exist.
49 | if [ ! -f "$TOOLS_DIR/packages.config" ]; then
50 | echo "Downloading packages.config..."
51 | curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages
52 | if [ $? -ne 0 ]; then
53 | echo "An error occurred while downloading packages.config."
54 | exit 1
55 | fi
56 | fi
57 |
58 | # Download NuGet if it does not exist.
59 | if [ ! -f "$NUGET_EXE" ]; then
60 | echo "Downloading NuGet..."
61 | curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
62 | if [ $? -ne 0 ]; then
63 | echo "An error occurred while downloading nuget.exe."
64 | exit 1
65 | fi
66 | fi
67 |
68 | # Restore tools from NuGet.
69 | pushd "$TOOLS_DIR" >/dev/null
70 | if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' )" ]; then
71 | find . -type d ! -name . ! -name 'Cake.Bakery' | xargs rm -rf
72 | fi
73 |
74 | mono "$NUGET_EXE" install -ExcludeVersion
75 | if [ $? -ne 0 ]; then
76 | echo "Could not restore NuGet tools."
77 | exit 1
78 | fi
79 |
80 | $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5"
81 |
82 | popd >/dev/null
83 |
84 | # Restore addins from NuGet.
85 | if [ -f "$ADDINS_PACKAGES_CONFIG" ]; then
86 | pushd "$ADDINS_DIR" >/dev/null
87 |
88 | mono "$NUGET_EXE" install -ExcludeVersion
89 | if [ $? -ne 0 ]; then
90 | echo "Could not restore NuGet addins."
91 | exit 1
92 | fi
93 |
94 | popd >/dev/null
95 | fi
96 |
97 | # Restore modules from NuGet.
98 | if [ -f "$MODULES_PACKAGES_CONFIG" ]; then
99 | pushd "$MODULES_DIR" >/dev/null
100 |
101 | mono "$NUGET_EXE" install -ExcludeVersion
102 | if [ $? -ne 0 ]; then
103 | echo "Could not restore NuGet modules."
104 | exit 1
105 | fi
106 |
107 | popd >/dev/null
108 | fi
109 |
110 | # Make sure that Cake has been installed.
111 | if [ ! -f "$CAKE_EXE" ]; then
112 | echo "Could not find Cake.exe at '$CAKE_EXE'."
113 | exit 1
114 | fi
115 |
116 | # Start Cake
117 | exec mono "$CAKE_EXE" $SCRIPT "${CAKE_ARGUMENTS[@]}"
118 |
--------------------------------------------------------------------------------
/images/gradient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/SignaturePad/b322851780140704996acbdddf1d19073bf122a7/images/gradient.png
--------------------------------------------------------------------------------
/images/signature-ios.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/SignaturePad/b322851780140704996acbdddf1d19073bf122a7/images/signature-ios.jpg
--------------------------------------------------------------------------------
/images/signature-pad-glyph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/SignaturePad/b322851780140704996acbdddf1d19073bf122a7/images/signature-pad-glyph.png
--------------------------------------------------------------------------------
/images/signature-pad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/SignaturePad/b322851780140704996acbdddf1d19073bf122a7/images/signature-pad.png
--------------------------------------------------------------------------------
/images/signature-pad_1024x1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/SignaturePad/b322851780140704996acbdddf1d19073bf122a7/images/signature-pad_1024x1024.png
--------------------------------------------------------------------------------
/images/signature-pad_128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/SignaturePad/b322851780140704996acbdddf1d19073bf122a7/images/signature-pad_128x128.png
--------------------------------------------------------------------------------
/images/signature-pad_256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/SignaturePad/b322851780140704996acbdddf1d19073bf122a7/images/signature-pad_256x256.png
--------------------------------------------------------------------------------
/images/signature-pad_512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/SignaturePad/b322851780140704996acbdddf1d19073bf122a7/images/signature-pad_512x512.png
--------------------------------------------------------------------------------
/nuget/Xamarin.Controls.SignaturePad.Forms.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Xamarin.Controls.SignaturePad.Forms
6 | SignaturePad for Xamarin.Forms
7 | $version$
8 | Microsoft
9 | Microsoft
10 | true
11 | https://go.microsoft.com/fwlink/?linkid=874508
12 | https://go.microsoft.com/fwlink/?linkid=874507
13 | https://go.microsoft.com/fwlink/?linkid=874510
14 | Makes capturing, saving, and displaying signatures extremely simple.
15 | https://go.microsoft.com/fwlink/?linkid=874509
16 | © Microsoft Corporation. All rights reserved.
17 | xamarin,signature,handwriting,windows,ios,android,uwp,xamarin.forms
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/nuget/Xamarin.Controls.SignaturePad.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Xamarin.Controls.SignaturePad
6 | SignaturePad for Xamarin and Windows
7 | $version$
8 | Microsoft
9 | Microsoft
10 | true
11 | https://go.microsoft.com/fwlink/?linkid=874508
12 | https://go.microsoft.com/fwlink/?linkid=874507
13 | https://go.microsoft.com/fwlink/?linkid=874510
14 | Makes capturing, saving, and displaying signatures extremely simple.
15 | https://go.microsoft.com/fwlink/?linkid=874509
16 | © Microsoft Corporation. All rights reserved.
17 | xamarin,signature,handwriting,windows,ios,android,uwp
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/samples/Sample.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using Android.App;
3 | using Android.Graphics;
4 | using Android.OS;
5 | using Android.Support.V7.App;
6 | using Android.Widget;
7 |
8 | using Xamarin.Controls;
9 |
10 | namespace Sample.Android
11 | {
12 | [Activity (MainLauncher = true)]
13 | public class MainActivity : AppCompatActivity
14 | {
15 | private System.Drawing.PointF[] points;
16 |
17 | protected override void OnCreate (Bundle bundle)
18 | {
19 | base.OnCreate (bundle);
20 |
21 | SetContentView (Resource.Layout.main);
22 |
23 | var signatureView = FindViewById (Resource.Id.signatureView);
24 |
25 | var btnSave = FindViewById