Hey guys,
I'm working on a tiny app, which creates images. Most parts are working pretty well, some bugs as usually.
But one thing is making me mad. If I create an Image (JPG) it needs at least 10 Minutes, sometimes a reboot, till the images appears in the gallery.
Did anyone got that problem, and if, how did you solved it?
Here is my code
class savePic { public void Save(string directory, Bitmap bitmap) { int dirLength = directory.Length; for (int i = dirLength; i > 0; i--) { if (directory.Substring((i - 1), 1) == ".") { directory = directory.Substring(0, i - 1) + "_overlay.jpg"; } } var sdCardPath = Android.OS.Environment.ExternalStorageDirectory.Path; var filePath = System.IO.Path.Combine(sdCardPath, directory); var stream = new FileStream(filePath, FileMode.Create); bitmap.Compress(Bitmap.CompressFormat.Jpeg, 100, stream); stream.Close(); } }
Regards
Buzz