ImageList.ColorDepth 屬性

定義

取得或設定影像清單的色彩深度。

public:
 property System::Windows::Forms::ColorDepth ColorDepth { System::Windows::Forms::ColorDepth get(); void set(System::Windows::Forms::ColorDepth value); };
public System.Windows.Forms.ColorDepth ColorDepth { get; set; }
member this.ColorDepth : System.Windows.Forms.ColorDepth with get, set
Public Property ColorDepth As ColorDepth

屬性值

影像可用的色彩數。 在透過 .NET 7 .NET Framework 和 .NET (Core) 版本中,預設值為 Depth8Bit 。 在 .NET 8 和更新版本中,預設值為 Depth32Bit

例外狀況

這個色彩深度不是有效的 ColorDepth 列舉值。

備註

當您將色彩深度設定為新值時, Handle 會重新建立影像清單的 。 因為設定 ColorDepth 屬性會導致重新建立控制碼,所以您應該在設定 Images 屬性之前設定 ColorDepth 。 建立 的控制碼 ImageList 之後,在設定 屬性之後,在程式碼中設定 ColorDepthImagesImageSize 屬性,將會導致為屬性設定 Images 的影像集合遭到刪除。

適用於

另請參閱