獲取顏色深度
色深是以每像素位數或bpp來衡量,用於提供有關顏色組成的資訊,無論是用於表示單個像素的顏色的位數,還是用於單個像素的每個顏色組件的位數。 它還可以用來在某些情況下確定圖像的質量,因為不同的圖像 bpp 會導致圖像質量的差異(bpp 越高,圖像定義越高)。
可以從檔案路徑載入要讀取的圖像檔案 AnyBitmap.FromFile(@"FILE_PATH")
。 .BitsPerPixel
然後可以用於生成的 AnyBitmap 以獲取色彩深度。
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);
Imports IronSoftware.Drawing Imports System ' Load an AnyBitmap from a file Private sample As AnyBitmap = AnyBitmap.FromFile("FILE_PATH") ' Gets and prints the color depth in terms of bits per pixel Private colorDepth = sample.BitsPerPixel Console.WriteLine(colorDepth)
Install-Package IronSoftware.System.Drawing
色深是以每像素位數或bpp來衡量,用於提供有關顏色組成的資訊,無論是用於表示單個像素的顏色的位數,還是用於單個像素的每個顏色組件的位數。 它還可以用來在某些情況下確定圖像的質量,因為不同的圖像 bpp 會導致圖像質量的差異(bpp 越高,圖像定義越高)。
可以從檔案路徑載入要讀取的圖像檔案 AnyBitmap.FromFile(@"FILE_PATH")
。 .BitsPerPixel
然後可以用於生成的 AnyBitmap 以獲取色彩深度。