ListView圖標圖像不清晰的解決方法

其實不清晰的緣由是ListView.LargeImageList的圖像深度不高,默認的是8bit,因此解決的方法就是:c#

                    filesList.LargeImageList = new ImageList();
                    //修正圖片不清晰的BUG
                    //默認是8bit
                    filesList.LargeImageList.ColorDepth = ColorDepth.Depth32Bit;
                    filesList.LargeImageList.ImageSize = new Size(128, 150);

ImageList.ColorDepth 屬性提示爲:獲取圖像列表的顏色深度。是誤導咱們,覺得是隻讀的,正確的應該是:「獲取或設置圖像列表的顏色深度」。從C#的語法定義中能夠發現。spa

C#定義:public ColorDepth ColorDepth { get; set; }
相關文章
相關標籤/搜索