3

I am new to xamarin. I want to build a xamarin forms application to take picture and save it in the gallery. I built the app to take photo and display it by using the following article.

https://xamarinhelp.com/use-camera-take-photo-xamarin-forms/

But I don't know how to save the image in the gallery in xamarin forms.Can anyone help me to save the image using dependency service in xamarin forms?

1 Answer 1

3

The article you shared uses MediaPlugin by jamesmontemagno. It has its own comprehensive getting-started docs, that I would recommend to go through.

In order to save picture to gallery, you can use SaveToAlbum in StoreCameraMediaOptions.

var photo = await CrossMedia.Current.TakePhotoAsync( new StoreCameraMediaOptions { SaveToAlbum = true }); 
Sign up to request clarification or add additional context in comments.

2 Comments

How to save an image to gallery which is in the in the display or in the drawable folder?
I haven't tried it myself. But I would imagine you should be able to get an input stream for that resource and then use File or similar option to save it to storage.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.