Search code examples
xamarinbackground-imagesignaturepad

Xamarin - SignaturePad BackgroundImageView trouble


Having trouble getting this to work - I must be missing something:

signaturePad2.BackgroundImageView = new ImageView(Context)
{
   Id = GenerateId(this),
   LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent)
};

signaturePad2.AddView(BackgroundImageView);
signaturePad2.BackgroundImage = MyGlobals.FileNameOfPhotoTaken;

Solution

  • BackgroundImage is of type ImageSource

    padView.BackgroundImage = ImageSource.FromUri(new Uri(
        "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Xamarin-logo.svg/220px-Xamarin-logo.svg.png"));