IRONSOFTWAREHOME
取得色彩深度
using IronSoftware.Drawing;
using System;

// Load an AnyBitmap from a file
AnyBitmap sample = AnyBitmap.FromFile(@"FILE_PATH");

// Gets and prints the color depth in terms of bits per pixel
var colorDepth = sample.BitsPerPixel;
Console.WriteLine(colorDepth);
NuGet Download
PM > Install-Package IronSoftware.System.Drawing
取得色彩深度

取得色彩深度

色深是以每個像素的位元數(bpp)來測量,用於提供顏色成分的資訊。 這可以是指示單個像素顏色的位元,或用於單個像素每個顏色成分的位元數。 它也可以用來決定圖像的質量,因為不同的圖像bpp會導致不同的圖像質量(較高的bpp通常表示圖像有更多的細節)。

可以使用AnyBitmap.FromFile("FILE_PATH")從檔案路徑讀取圖像檔。 You can then use .BitsPerPixel on the generated AnyBitmap object to get the color depth of the image.

在GitHub上查看

準備開始了嗎?

Nuget Downloads 19,661,086版本:2025.3剛剛發布

Key in blue circle

立即免費取得 30 天試用金鑰

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
獲取您的無義務諮詢
填寫以下表格或發送電子郵件至sales@ironsoftware.com
您的詳細資訊將始終保密。
被全球數百萬工程師信任
Iron Software的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立