【发布时间】:2019-01-04 02:20:59
【问题描述】:
我想将签名板的图像保存在我的设备中,并获取我保存图像的文件路径。我正在使用 xamarin-controls-signature-pad nuget 包来捕获我的签名。请参阅下面的代码:
Stream sigimage = await Signature.GetImageStreamAsync(SignaturePad.Forms.SignatureImageFormat.Png);
string fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), signatureFile);
using (var fileStream = new FileStream(fileName, FileMode.Create, FileAccess.Write))
{
await sigimage.CopyToAsync(fileStream);
}
if (File.Exists(fileName))
{
await DisplayAlert("File", "File exist", "ok");
}
else
{
await DisplayAlert("File", "File does not exist", "ok");
}
【问题讨论】:
标签: xamarin xamarin.forms stream signaturepad