我試圖保存圖片並在行bitmapImg.Compress(Bitmap.CompressFormat.Png,90,fos);顯示錯誤無法將Java.IO.FileOutputStream轉換爲System.IO.Stream。如何解決它?無法將Java.IO.FileOutputStream轉換爲System.IO.Stream?
File file = new File(Android.OS.Environment.DirectoryPictures + File.Separator + "newProdict.png");
FileOutputStream fos = null;
try
{
fos = new FileOutputStream(file);
if (fos != null)
{
bitmapImg.Compress(Bitmap.CompressFormat.Png, 90, fos);
fos.Close();
}
}
catch (Exception ex) { }
位圖是我的圖像m試圖保存到智能手機的畫廊。 C# –
我相信你應該用FileStream代替FileOutputStream –
編輯我的回答路徑 –