ListView图标图像不清晰的解决方法

其实不清晰的原因是ListView.LargeImageList的图像深度不高,默认的是8bit,所以解决的方法就是:

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

ImageList.ColorDepth 属性提示为:获取图像列表的颜色深度。是误导我们,以为是只读的,正确的应该是:“获取或设置图像列表的颜色深度”。从C#的语法定义中可以发现。

C#定义:public ColorDepth ColorDepth { get; set; }


你可能感兴趣的:(ListView图标图像不清晰的解决方法)