Install-Package Zou.Signature
axml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/clear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Clear" />
<Button
android:id="@+id/getsvg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Get Svg" />
<Zou.Signature.SignatureView
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
activity:
public class MainActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
var view = FindViewById<SignatureView>(Resource.Id.view);
Button clear = FindViewById<Button>(Resource.Id.clear);
clear.Click += (s, e) =>
{
view.Clear();
};
Button getsvg = FindViewById<Button>(Resource.Id.getsvg);
getsvg.Click += (s, e) =>
{
var svg = view.GetSVGString();
var bitmap = view.GetBitmap();
};
}
}