c# - 在 Windows Phone 7 中获取 EXIF 标签

标签 c# silverlight windows-phone-7 exif

我想获取我在 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();

textBox1textBox2 都显示 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/

相关文章:

windows-phone-7 - WP7 : IsolatedStorage vs. 可写位图

C# 捕获屏幕到 8 位(256 色)位图

javascript - 如何让 <div> 垂直居中?

silverlight - 重用现有的 Storyboard

c# - 来自 XNA GamerService 的无效跨线程访问

iphone - Windows Phone 7 是否有标准的编辑/添加/删除约定?

c# - 在后端类中使用 MethodInvoker

c# - C# 删除立即窗口中的变量

由 C# clearcase : How to edit file then check it out and then check it in with the saved changes?

.net - Silverlight 4.0 和 WCF 客户端代理 - 如何创建和关闭实例