Hi,
I try to use SfImageEditor. So I add a Shape with a Path.
First attempt :
var signature = new SfImageEditor {
Margin = 0,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
};
signature.ToolbarSettings.IsVisible = false;
signature.AddShape(ShapeType.Path, new PenSettings { Color = Color.Black, StrokeWidth = 2f });
signatureBorder.Content = signature;
With this code it doesn't draw anything.
Second attempt :
var signature = new SfImageEditor {
Margin = 0,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
};
signature.ToolbarSettings.IsVisible = false;
Device.StartTimer(TimeSpan.FromMilliseconds(1000), () => {
signature.AddShape(ShapeType.Path, new PenSettings { Color = Color.Black, StrokeWidth = 2f });
return false;
});
signatureBorder.Content = signature;
With this code it does draw but I have some exception when I touch the element too fast :
12-31 10:36:40.416 I/MonoDroid( 1187): System.NullReferenceException: Object reference not set to an instance of an object.
12-31 10:36:40.417 I/MonoDroid( 1187): at Syncfusion.SfImageEditor.Android.DrawShapeView.TouchMove (System.Single x, System.Single y) [0x00055] in <eadafab7c9844b21b2dadcb8abad79e4>:0
12-31 10:36:40.417 I/MonoDroid( 1187): at Syncfusion.SfImageEditor.Android.DrawShapeView.OnTouchMove (Android.Views.MotionEvent e) [0x00016] in <eadafab7c9844b21b2dadcb8abad79e4>:0
12-31 10:36:40.417 I/MonoDroid( 1187): at Syncfusion.SfImageEditor.Android.DrawShapeView.OnTouchEvent (Android.Views.MotionEvent e) [0x0002d] in <eadafab7c9844b21b2dadcb8abad79e4>:0
12-31 10:36:40.417 I/MonoDroid( 1187): at Syncfusion.SfImageEditor.Android.ZoomLayout.OnTouchEvent (Android.Views.MotionEvent e) [0x00389] in <eadafab7c9844b21b2dadcb8abad79e4>:0
12-31 10:36:40.417 I/MonoDroid( 1187): at Android.Views.View.n_OnTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <82e50ec67af648c3b9f43b3d70e21b96>:0
12-31 10:36:40.417 I/MonoDroid( 1187): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.39(intptr,intptr,intptr)
I need some help on this. Thanks.
Regards,
Benoît NELISSEN