Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Get images to Gallery instantly

$
0
0

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


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>