Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xamarin/SignaturePad
https://github.com/xamarin/SignaturePad
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/xamarin/SignaturePad
- Owner: xamarin
- License: mit
- Archived: true
- Created: 2014-04-14T19:02:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T19:32:41.000Z (over 3 years ago)
- Last Synced: 2024-09-28T09:23:25.815Z (3 months ago)
- Language: C#
- Size: 2.96 MB
- Stars: 246
- Watchers: 85
- Forks: 150
- Open Issues: 58
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - Signature Pad ★221
- awesome-xamarin - SignaturePad ★117 - Signature Pad makes capturing, saving, exporting, and displaying signatures extremely simple on Xamarin.iOS, Xamarin.Android and Windows. (UI)
README
# Signature Pad
[![Build Status](https://jenkins.mono-project.com/buildStatus/icon?job=Components-SignaturePad-Windows)](https://jenkins.mono-project.com/view/Components/job/Components-SignaturePad-Windows/) [![Build Status](https://jenkins.mono-project.com/buildStatus/icon?job=Components-SignaturePad)](https://jenkins.mono-project.com/view/Components/job/Components-SignaturePad/)
[![SignaturePad NuGet](https://img.shields.io/nuget/vpre/Xamarin.Controls.SignaturePad.svg?label=SignaturePad%20NuGet)](https://www.nuget.org/packages/Xamarin.Controls.SignaturePad) [![SignaturePad Xamairn.Forms NuGet](https://img.shields.io/nuget/vpre/Xamarin.Controls.SignaturePad.Forms.svg?label=SignaturePad.Forms%20NuGet)](https://www.nuget.org/packages/Xamarin.Controls.SignaturePad.Forms)
Signature Pad makes capturing, saving, exporting, and displaying signatures extremely simple on
Xamarin.iOS, Xamarin.Android and Windows.Not only is Signature Pad available for native apps, but also available in Xamarin.Forms apps.
![Screenshot](images/signature-ios.jpg)
---
## Using Signature Pad
Signature Pad can be installed from [NuGet.org][nuget-link] for native Xamarin and Windows apps:
```
nuget install Xamarin.Controls.SignaturePad
```And also for Xamarin.Forms apps:
```
nuget install Xamarin.Controls.SignaturePad.Forms
```### Using Signature Pad on iOS
```csharp
using Xamarin.Controls;var signatureView = new SignaturePadView (View.Frame) {
StrokeWidth = 3f,
StrokeColor = UIColor.Black,
BackgroundColor = UIColor.White,
};
```### Using Signature Pad on Android
```csharp
using Xamarin.Controls;var signatureView = new SignaturePadView (this) {
StrokeWidth = 3f,
StrokeColor = Color.White,
BackgroundColor = Color.Black
};
```### Using Signature Pad on Windows
```xml
```
### Using Signature Pad on Xamarin.Forms
```xml
```
### Obtaining a Signature Image
The signature that was drawn on the canvas can be obtained as a image using the `GetImage(...)`
method overloads. The resulting image will be in the native platform image type:```csharp
// iOS
UIImage image = signatureView.GetImage ();// Android
Bitmap image = signatureView.GetImage ();// Windows
WriteableBitmap bitmap = signatureView.GetImage ();
```For Xamarin.Forms, there is no "native" image format, but `GetImageStreamAsync` can be used instead
to retrieve an encoded (jpeg or png) image stream:```csharp
Stream bitmap = await signatureView.GetImageStreamAsync (SignatureImageFormat.Png);
```### Obtaining the Signature Points
In addition to retrieving the signature as an image, the signature can also be retrieved as
as an array of points:```csharp
var strokes = signatureView.Strokes;
```These strokes can be used to save and restore a signature:
```csharp
// restore strokes (iOS, Android, Windows)
signatureView.LoadStrokes (newStrokes);// restore strokes (Xamarin.Forms)
signatureView.Strokes = newStrokes;
```---
## License
The license for this repository is specified in [LICENSE](LICENSE).
## .NET Foundation
This project is part of the [.NET Foundation](http://www.dotnetfoundation.org/projects).[nuget-link]: https://www.nuget.org/packages/Xamarin.Controls.SignaturePad