0

I am using Signature pad to capture the signature in PCL. The code returns the signature file location with the file name. But the issue is to convert the image into byte array. I have seen multiple references but not working. below is the code sample where i am getting the location of the file with file name.

saveImageBtn.Clicked += (sender, e) =>{
      var value = DependencyService.Get<ISign>().Sign();
      drawingImage.SavedImagePath = value; // I am getting file location here 
      Navigation.PushModalAsync(new SignatureImagePage(drawingImage.SavedImagePath));
 };

i want to convert the file that i am getting in drawingImage.SavedImagePath. How can i do this.

Used reference previously :

Error - Bitmap could not found , Not any solution in this link, Not any Solution

Hope someone can provide me solution for this

A.Goutam
  • 3,422
  • 9
  • 42
  • 90
  • File.ReadAllBytes(path); – Jason Sep 05 '17 at 13:46
  • @Jason i try to use like byte[] array = File.ReadAllBytes(path); but error is File does not exists in current context. I have already used using System; – A.Goutam Sep 05 '17 at 13:51
  • using System.IO; – Jason Sep 05 '17 at 13:53
  • Can you show the value of SavedImagePath? – hugo Sep 05 '17 at 14:32
  • You can also get the stream from the SignaturePad instead of asking a file. See https://stackoverflow.com/questions/45955621/retrieve-image-from-signaturepadview-with-mvvm-architecture – hugo Sep 05 '17 at 14:33
  • or here https://stackoverflow.com/questions/44648485/stream-to-bytearray-convert-signature-pad-to-image/44662876#44662876 – Yuri S Sep 05 '17 at 15:56

0 Answers0