Android GetImageStreamAsync returns null
Dabbel opened this issue · 2 comments
Description
Calling GetImageStreamAsync returns null
Code
signaturePad = new SignaturePadView { StrokeWidth = Device.RuntimePlatform == Device.iOS ? 4 : 8, ClearText = "neu", CaptionText = "Hier unterschreiben", SignatureLineColor = Resources.Resources.ColorBrand, BackgroundColor = Color.White, StrokeColor = Color.FromHex("#999999"), VerticalOptions = LayoutOptions.FillAndExpand, HeightRequest = 300 };
var imgStream = await signaturePad.GetImageStreamAsync(SignatureImageFormat.Jpeg, Color.FromHex("#999999"), Color.White);
Expected Behavior
Should return stream or raise error if something goes wrong
Actual Behavior
Returns null
Basic Information
- Version with issue: 3.0.0
- Last known good version: N/A
- IDE: Visual Studio 2017 (15.8.6)
- Platform Target Frameworks:
- Android: 8.1
- Xamarin.Forms: 3.2.0.871581
- Target Devices:
- Huawei P Smart
Bump. This is broken. SignaturePad flat out wont return the image on Android and I cannot find a workaround. Is it going to be fixed? I spent a while trying to figure out whats up here. Tried using the native SignaturePadView with GetImage and still got nothing back. Tried loading the strokes from the Xamarin.forms project through a dependency service but bitmap comes back null as well.
In my Xamarin.forms project the app hangs and crashes in Android on GetImageStreamAsync but on iOS it works just fine.
Found the problem.
SignaturePad works as intended.
I used a popup control and reacted when it gets closed, at this time SignaturePadCanvasView is disposed and calling Xamarin.Controls.GetSize (View) results in the error.