簡體   English   中英

如何獲取位圖的屬性?

[英]how to get the properties of a bitmap?

我如何從位圖獲取版權日期?

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;
}

如果您要求獲取系統提供的詳細信息,那么您應該查看shell函數(shell32.dll)。 看看這篇SO 帖子

基本上,它不是保存在位圖本身中,而是保存在系統中。 它包含指定的評級,用戶,細節等。

將圖像加載到位圖對象並訪問exif數據。 請參閱此問題的第二個答案: 如何使用C#從文件中獲取EXIF數據

關於訪問Time和co使用FileInfo類。 另請參閱MSDN: http//msdn.microsoft.com/en-us/library/system.io.filesysteminfo.lastaccesstime.aspx

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM