我对Android非常陌生。我正在与Xamarin合作,我必须用相机拍照并保存图片。无法找到已保存的图片
我实现了拍照,我有一个Bitmap对象。然后我保存它没有错误,但当我试图找到它时,没有文件。
有我的代码:
Bitmap imgBmp = /* image initialized */
//Save image on folder
var folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var filePath = System.IO.Path.Combine(folderPath, "image1.png");
var stream = new System.IO.FileStream(filePath, FileMode.Create);
bool isOK = imgBmp.Compress(Bitmap.CompressFormat.Jpeg, 95, stream);
stream.Flush();
stream.Close();
我执行时没有错误,ISOK是真实的,但是当我搜索image.png我无法找到该文件。
随着调试器,我看到的路径是:/data/user/0/com.myCompagny.MyAppli/files/image1.png
但我看不到该文件夹。
有人可以帮我找到我的image1.png吗?
或将默认文件夹更改为像Pictures \ MyApplication \ image.png,但我不知道如何找到图像的默认文件夹。
您无法使用文件管理器访问此目录,因为它是系统专用目录。只有应用可以访问它,并且只有他们自己的私人目录。 –