我正在使用PCL的SignaturePad Nuget。
如何将此System.IO.Stream转换为图像?
任何想法都将不胜感激。谢谢。

发布于 2017-09-23 05:21:39
这是我对此进行了两周的研究后发现的。
这是在安卓手机上将签名保存到png文件的c#代码。
async void Enregistrer(object sender, EventArgs e)
{
// This is the code to get the image (as a stream)
var img = padView.GetImage(Acr.XamForms.SignaturePad.ImageFormatType.Png); // This returns the Bitmap from SignaturePad.
img.Seek(0,0); // This is to have the current position in the stream
// create a new file stream for writing
FileStream fs = new FileStream(Android.OS.Environment.ExternalStorageDirectory + "/imagefilename.png", FileMode.Create,FileAccess.Write); // create a new file stream for writing
await img.CopyToAsync(fs); // have the image stream to disk
fs.Close(); // close the filestream
img.Dispose(); // clear the ressourse used by the stream
}祝你玩得开心!
https://stackoverflow.com/questions/43215170
复制相似问题