代码之家  ›  专栏  ›  技术社区  ›  Thanatos

C#:使用带有多个图像的.ico文件

  •  7
  • Thanatos  · 技术社区  · 16 年前

    我试图在C#的TreeView中设置图像,该文件包含两个图标:32x32版本和16x16版本。图像正在设置中,但是。Net正在选择32x32版本,并将其缩小(看起来很糟糕),而不是选择现成的16x16图像。

    相关代码:

    ilTree.Images.Add(Properties.Resources.group);
    ilTree.Images.Add(Properties.Resources.single);
    ilTree.Images.Add(Properties.Resources.db);
    treeStored.ImageList = ilTree;
    

    我哪里做错了?


    在。NET Framework 1.1或更高版本,默认为Depth8Bit。

    20 颜色。

    2 回复  |  直到 16 年前
        1
  •  5
  •   snarf    16 年前

        2
  •  1
  •   rein    16 年前