本文介绍了ImageList中的图标大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

同事,

如您所知,.ico文件包含具有不同大小和颜色深度的多个图像.为了在树形视图中显示一个16x16的图标,我找到了一个.ico文件,该文件除其他尺寸外还具有适当的尺寸图像.我有一个ImageList,其中ImageSize设置为16x16.在设计时,我已将.ico加载到ImageList中.但是ImageList将此图标的PhysicalDimension显示为32x32(PhysicalDimension是只读的).看起来ImageList选择了错误的大小.

解决方法是,我可以提取所需的16x16图像并将其另存为单独的文件(可能采用其他格式).但是,是否有办法使ImageList从.ico文件中选择正确的大小?

任何建议,见解或参考都将受到赞赏!

-Nick

Colleagues,

As you know, the .ico files contain multiple images with different sizes and color depths. To display a 16x16 icon in my tree view, I found an .ico file which has the appropriate size image among other sizes. I’ve got an ImageList, with ImageSize set to 16x16. At design time, I’ve loaded the .ico into the ImageList. But the ImageList shows PhysicalDimension for this icon as 32x32 (PhysicalDimension is read-only). Looks like ImageList chose the wrong size.

As a workaround, I can extract the needed 16x16 image and save it as a separate file (may be in a different format). But, is there a way to make ImageList pick the right size from the .ico file?

Any suggestion, insight or reference is appreciated!

- Nick

推荐答案


这篇关于ImageList中的图标大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 00:42