How do I set properties of jpeg file in Xamarin for Android?

≯℡__Kan透↙ 提交于 2020-01-11 07:50:35

问题


I am working with jpeg files, when I look at the details of a jpeg file under windows (right-click->properties), under the Details tab there are entries for Title, Subject, Rating, Tags, Comments, etc. How can I set these properties in Xamarin (Android)? Thanks.


回答1:


Here is some code to guide you.

ExifInterface newExif= new ExifInterface(filePath);
newExif.SetAttribute(ExifInterface.TagGpsLatitude, "teste lat");
newExif.SetAttribute(ExifInterface.TagGpsLatitudeRef, "teste lat ref");
newExif.SetAttribute(ExifInterface.TagGpsLongitude, "teste long");
newExif.SetAttribute(ExifInterface.TagGpsLongitudeRef, "teste long ref");
newExif.SaveAttributes();



回答2:


You can use Android.Media.ExifInterface for getting/setting Exif Properties in Xamarin.Android.

http://developer.android.com/reference/android/media/ExifInterface.html



来源:https://stackoverflow.com/questions/25803587/how-do-i-set-properties-of-jpeg-file-in-xamarin-for-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!