2012-03-26 53 views
0

如何从位图获取版权日期?如何获取位图的属性?

private void toolStripMenuItemLoadImage_Click(object sender, EventArgs e) 
{ 
    using (OpenFileDialog ofd = new OpenFileDialog()) 
    { 
     ofd.Title = "Load Image"; 

     if (ofd.ShowDialog() == DialogResult.OK) 
     { 
      firstLoaded = new Bitmap(ofd.FileName); 
      String details = //Grab the copyright date of the image here; 
      this.Invalidate(); 
     } 
    } 
    isLoaded = true; 
} 
+1

你是什么意思版权日期? – SimpleVar 2012-03-26 05:22:49

+0

对于这样的事情,位图文件格式没有空间。 – 2012-03-26 05:24:12

+0

我的意思是像图片的创建日期,最后修改等等的东西...这可能吗? – BigBug 2012-03-26 05:30:55

回答

2

如果您要求获取系统提供的详细信息,那么您应该查看shell函数(shell32.dll)。看看这个SO post

基本上,它不是保存在位图本身,而是保存在系统中。它包含像指定的评分,用户,细节等。

0

将图像加载到位图对象并访问exif数据。看到这个问题的第二个答案:How to get the EXIF data from a file using C#

关于访问时间和共同使用FileInfo类。另请参阅MSDN:http://msdn.microsoft.com/en-us/library/system.io.filesysteminfo.lastaccesstime.aspx

+1

我没有想到EXIF数据存储在Windows位图文件中。 – 2012-03-26 05:27:09

+1

BMP文件具有AFIK没有版权数据。顺便说一句,如果它不常见PNG也支持EXIF。 – rekire 2012-03-26 05:29:32