Preventing color bleeding with StateImageList on TreeView

Does anyone have a solution for color bleeding when using StateImageList with Windows Forms TreeView?

Using the same ImageList with the assignment of the TreeView ImageList property results in the correct display, as can be seen from the following image.

24 bit

Status images are left, normal images are correct. All images are from a single ImageList instance.

Update:

I converted the images to 16 color indexed palettes. It doesn't seem to like that either. This is a little better, but still far from acceptable.

4 bit

+3
source share
3 answers

.ColorDepth .StateImageList :

.NET Framework 1.1 Depth8Bit.

, "default" . , , .

Reflector, StateImageList TreeView, . . imagelist, , StateImageList .

EDIT: , , . , . , 4- , , , StateImageList. "8 " , , StateImageList - 4- (, 16- ) .

4- , , imagelist stateimagelist.

alt text http://www.freeimagehosting.net/uploads/74873abc94.png

imagelist, 16- Windows. , stateimagelist.

+3

, .

ColorDepth ImageList, Depth24Bit ?

0

The ColorDepth property must be set to Depth24Bit before adding an image to ImageList. In my case, it helped.

0
source

Source: https://habr.com/ru/post/1725027/


All Articles