M.D.
M.D.

Reputation: 273

Xamarin SignaturePadView GetImage Android Black Background

I always get a black background color, even when I set it to white:

  SignaturePadView sigView = new SignaturePadView(Forms.Context);
  sigView.StrokeColor = Color.Black;
  sigView.BackgroundColor = Color.White;
  var stream = await sigView.GetImageStreamAsync(SignatureImageFormat.Jpeg);

It is working on iOS, but Android doesn't. Is there something else I can do to get a white background?

EDIT: The resulting jpg-file has a black background, not the view!

Upvotes: 1

Views: 1225

Answers (2)

Yann
Yann

Reputation: 543

Saving transparent layer in jpg results in black background. Save in png instead to keep the alpha layer.

Upvotes: 2

VK Mallaya
VK Mallaya

Reputation: 394

Can you try using GetImage method of the Signature pad View ?

sigView.GetImage(Android.Graphics.Color.Black, Android.Graphics.Color.White, false);

We uses this and gets in white background with black signature.

Upvotes: 3

Related Questions