Add location information to captured images
木幡 弘文
1
Reputation point
I'm starting the camera by using Plugin.Media.CrossMedia.Current.
How can I add location information?
I also want to shoot continuously, do I need to write it separately?
I have been able to shoot and save, but please tell me how to add location information and shoot continuously.
private async void OnImageClicked()
{
await Plugin.Media.CrossMedia.Current.Initialize();
if (!Plugin.Media.CrossMedia.Current.IsCameraAvailable || !Plugin.Media.CrossMedia.Current.IsTakePhotoSupported)
{
return;
}
DateTime dt = DateTime.Now;
string result = dt.ToString("yyyyMMddHHmmss");
result += ".jpg";
Plugin.Media.Abstractions.MediaFile file = await Plugin.Media.CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
Name = result
});
if (file == null)
{
return;
}
Queue<byte> bytes = new Queue<byte>();
using (Stream s = file.GetStream())
{
long length = s.Length;
int b;
while ((b = s.ReadByte()) != -1)
{
bytes.Enqueue((byte)b);
}
}
File.Copy("XXXXXXXXX/Pic");
PicPoint.Add(result);
file.Dispose();
}
Sign in to answer