2012-03-26 51 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