【问题标题】:Poor image quality in ListViewListView 中的图像质量差
【发布时间】:2010-12-09 16:53:37
【问题描述】:

我正在用项目填充 ListView 并添加来自 ImageList 的图像(在设计器中)。但是,即使我已将 ImageList 中的图像大小设置为其原始大小 (16x16),图像的显示质量也很差。看看:

Terrible image quality http://balazsbotond.hu/downloads/listview-icons.png

原始图像是漂亮、清晰的 PNG 图标。我能做什么?

【问题讨论】:

    标签: c# winforms image listview


    【解决方案1】:

    为了获得更高质量的图像,我们必须为 ImageList 使用更高的 ColorDepth。 C# 中允许的更高深度是 Depth32Bit

    示例用法如下所示

    imgLstPhotos.ColorDepth = ColorDepth.Depth32Bit;
    

    参考截图:

    【讨论】:

      【解决方案2】:

      试试这行代码。

      ImageList1.ColorDepth = ColorDepth.Depth16Bit;
      

      【讨论】:

        【解决方案3】:

        嗯,这很容易。添加图像后不要更改 ImageList 的图像大小 :)

        【讨论】:

          【解决方案4】:

          更改您用于列表视图的 imagesList 的颜色深度,并根据 PNG(如 Depth32Bit)尝试更高的颜色深度,您会看到差异。

          【讨论】:

            猜你喜欢
            • 2021-02-16
            • 2020-10-08
            • 1970-01-01
            • 1970-01-01
            • 2014-12-24
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多