Share via


ImageList.ColorDepth Properti

Definisi

Mendapatkan atau mengatur kedalaman warna daftar gambar.

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

Nilai Properti

Jumlah warna yang tersedia untuk gambar. Dalam versi .NET Framework dan .NET (Core) melalui .NET 7, defaultnya adalah Depth8Bit. Di .NET 8 dan versi yang lebih baru, defaultnya adalah Depth32Bit.

Pengecualian

Kedalaman warna bukan nilai enumerasi yang valid ColorDepth .

Keterangan

Saat Anda mengatur kedalaman warna ke nilai baru, Handle untuk daftar gambar dibuat ulang. Karena mengatur ColorDepth properti menyebabkan handel dibuat ulang, Anda harus mengatur ColorDepth sebelum mengatur Images properti . Ketika handel untuk ImageList telah dibuat, mengatur ColorDepth properti atau ImageSize dalam kode, setelah mengatur Images properti, akan menyebabkan kumpulan gambar yang diatur untuk Images properti dihapus.

Berlaku untuk

Lihat juga