Take in picture (just in memory) C# VisualStudio 2012

MartinSieradzkiMartinSieradzki Martin SieradzkiDEMember
edited September 2013 in Xamarin.Android

Hello Community,

i've got a question. I want to take a picture without writing anything to the internal storage.
I'm doing it with the following code (Take a picture => save in variable from storage => delete from storage).
But this doesn't work on every device, on some devices the pictures doesn't get deletet, it's just unreadable after "File.Delete()".

Here is my code:

<br /> protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)<br /> {<br /> base.OnActivityResult(requestCode, resultCode, data);<br /> switch (requestCode)<br /> {<br /> case (1):<br /> {<br /> var s = GetFilePathFromContentUri(Uri.Parse(data.DataString));<br /> var bitMap = BitmapHelpers.ResizeImage(s, 1024);<br /> new File(s).Delete();<br /> order.OrderImages.Add(new OrderImage(BmpToBytes(bitMap)));<br /> FillPreview();<br /> }<br /> break;<br /> }<br /> }<br />

I also tried File.Delete(s).

I hope you can help me.

best regards


Sign In or Register to comment.