列表视图图标显示模糊(C#)

发布于 2024-07-06 08:07:25 字数 622 浏览 16 评论 0原文

我试图在列表视图控件中显示“LargeIcon”视图,但是我指定的图像是模糊的。 这是我到目前为止所拥有的: 替代文本 http://img220.imageshack.us/img220/1005/blurryiconsql3.jpg

.png 文件的大小为 48x48,这就是我在 ImageList 属性中设置的显示大小。 我注意到一件事(这可能是原因),但我不知道如何改变它。 在“图像集合编辑器”中,您可以为 ImageList 控件选择所需的图像,但看起来它为每个图像设置了错误的大小。 替代文本 http://img83.imageshack.us/img83/5218/imagepropertiesmf9.jpg

如您所见,“PhysicalDimension”和“Size”设置为 16x16 并且无法进行操作。 有人有什么想法吗? 非常感谢!

I'm attempting to display a "LargeIcon" view in a listview control, however the images I specify are blurry. This is what I have so far:
alt text http://img220.imageshack.us/img220/1005/blurryiconsql3.jpg

The .png files are 48x48 and that's what I have it set to display at in the ImageList properties. There's one thing that I've noticed (which is probably the cause) but I don't know how to change it. Inside the "Images Collection Editor" where you choose what images you want for the ImageList control, it looks like it's setting the wrong size for each image.
alt text http://img83.imageshack.us/img83/5218/imagepropertiesmf9.jpg

As you can see the "PhysicalDimension" and the "Size" is set to 16x16 and not abled to be manipulated. Does anyone have any ideas? Many thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

无风消散 2024-07-13 08:07:25

请务必将 ImageList.ImageSize 也设置为 48 x 48。

Be sure to set ImageList.ImageSize to 48 x 48 too.

若无相欠,怎会相见 2024-07-13 08:07:25

添加 .PNG 图标格式大小时,编辑器倾向于选择该文件中的第一个条目大小,因此它选择 16x16 条目并将其拉伸。 这就是您在属性中看到 16x16 的原因。 正如所建议的,对 PNG 的支持很差,我经常发现自己转而使用另一种格式来避免这种情况。

如果您需要免费编辑器或功能更齐全的工具,例如 Photoshop 或 Fireworks,并提取您想要的确切尺寸。

When adding a .PNG Icon format size the editor tends to pick the first entry size in that file, so it picks up the 16x16 entry and it's stretching that out. That's why you see the 16x16 in the properties there. As suggested, the support for PNG is poor, I'm often found myself rolling over to another format as well to avoid this.

You can open the file in Paint.Net if you need a free editor or something more fully featured like Photoshop or Fireworks and extract the exact size you want.

娇妻 2024-07-13 08:07:25

另请检查 ImageList 上的 ColorDepth 设置。 我对 TreeView 控件也有类似的问题,但在阅读了之前关于大小的帖子后,我发现了这个设置,并对其进行了一些尝试,发现它极大地影响了 ImageList 中图像的渲染方式。 深度越高,质量越好。

Check also the ColorDepth setting on your ImageList. I had a similar issue with a TreeView control, but after reading the previous posting regarding the size I found this setting, played around with it a bit and found that it greatly affects the way images from an ImageList are rendered. The higher the depth the better the quality.

一身仙ぐ女味 2024-07-13 08:07:25

我不确定这是否是这个特定情况下的问题,但微软对 PNG 格式的支持通常很差。 尝试添加 .bmp 格式的图像,它们应该可以正常显示。

I'm not sure if its the problem in this specific case, but Microsoft support for the PNG format is generally poor. Try adding the images in .bmp format and they should display fine.

东走西顾 2024-07-13 08:07:25

添加图像之前,请务必将 ImageList 大小设置为 48x48 像素。

如果 ImageList 设置为 32x32 并且您添加了 48x48 图像,则图标大小将调整为 32x32。 当您随后将 ImageList 更改为 48x48 时,图像会再次调整大小,从而降低质量并变得模糊。

此外,Paint.NET(或 Photoshop)无法打开 .ico 文件。

Visual Studio/.NET 可以很好地处理 32 位 PNG 图像,但 VS 中的内置图像编辑器有点乏善可陈。

Be sure to set the ImageList size to 48x48 px BEFORE you add the images.

If the ImageList is set to 32x32 and you add a 48x48 image, the icon is resized to 32x32. When you change the ImageList to 48x48 afterwards, the image is just resized again, thus losing quality and going blurry.

Also, Paint.NET (or Photoshop) can't open .ico files.

Visual Studio/.NET can handle 32-bit PNG images fine, the built-in image editor in VS is a bit lack-lustre though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文