我想获取我在 Windows Phone 7 中拍摄的图像的所有 EXIF 标签。我尝试过使用 ExifLib,但似乎无法正确处理。
在我的 CaptureImageAvailable
事件处理程序中,我有以下代码:
JpegInfo info = ExifReader.ReadJpeg(e.ImageStream, "Pic.jpeg");
Dispatcher.BeginInvoke(delegate()
{
textBox1.Text = info.ExposureTime.ToString();
textBox2.Text = info.FNumber.ToString();
});
e.ImageStream.Close();
textBox1
和 textBox2
都显示 0。
我的“Cam.Capture 事件”每 200 毫秒触发一次。这对这些值有什么影响吗?
任何帮助将不胜感激! :)
最佳答案
我认为您的代码一切正常,只是未设置值。
这里有证据表明这不是你的错:
看看this blog post这基本上是阅读 EXIF 数据的教程。里面有一张数据截图:设置了很多值,但你需要的也是0。但我不确定这张照片是否真的是用手机相机拍的。
所以我自己测试了一下,数值如下;您需要的字段也为 0:
Artist "" Copyright null DateTime "2011:11:01 20:50:07" Description null ExposureTime 0.0 FileName "\\Applications\\Data\\[GUID]\\Data\\PlatformData\\CameraCapture-[GUID].jpg.jpg" FileSize 789355 Flash No FNumber 0.0 GpsLatitude {double[3]} GpsLatitudeRef Unknown GpsLongitude {double[3]} GpsLongitudeRef Unknown Height 1944 IsColor true IsValid true LoadTime {00:00:00.1340000} Make "HTC" Model "7 Trophy" Orientation TopRight ResolutionUnit Inch Software "Windows Phone 7.5" ThumbnailData {byte[14913]} ThumbnailOffset 518 ThumbnailSize 14913 UserComment null Width 2592 XResolution 72.0 YResolution 72.0
看起来像每 200 毫秒对 EXIF 做些什么不是原因。出于好奇,我在将图片与 PC 同步后再次查看了 EXIF 数据。这些值只是不存在。对不起。
关于c# - 在 Windows Phone 7 中获取 EXIF 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7969063/