如何在CListCtrl中显示不同尺寸的图像

发布于 2024-08-04 19:37:13 字数 79 浏览 2 评论 0原文

在我的MFC程序中,我想在列表中显示不同大小的图像! 我使用CListCtrl和CImageList! 但CImageList只能加载固定图像!

In my MFC program,I want to display different size images in a list!
I use CListCtrl and CImageList!
But the CImageList only can load fixed images!

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

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

发布评论

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

评论(3

情定在深秋 2024-08-11 19:37:13

不支持 CListCtrl 中的可变行高。您可以看一下 这篇文章,它描述了一个基于 CWnd 的控件处理可变行高的绘制。

Variable row heights in CListCtrl is not supported. You could take a look at this article that describes a control based on CWnd that handles drawing of variable row heights.

北音执念 2024-08-11 19:37:13

我会考虑使用所谓的“所有者绘制”模式自己绘制这些。我不知道另一种选择(没有内置模式)...也许您也可以采用最大尺寸并将较小的图像放入较大的框架中,但我认为这将是相同的工作并且效率较低...

我的意思是使用
CListCtrl::DrawItem()
方法

I would consider to use the so called "owner drawn" mode to draw these myself. I don't know about another option (there is no built-in mode)... Maybe you can also take the biggest size and fit the smaller images into the bigger frames but I think it will be the same effort and be less efficient...

I mean use the
CListCtrl::DrawItem()
method

回忆那么伤 2024-08-11 19:37:13

在对话框或表单上创建一个“网格”,很可能是一个非对称网格。然后根据您的选择用不规则形状的图像填充它。如果您需要更多空间,请查看可滚动“任何”视图、对话框等。

< strong>不规则或非矩形位图似乎是一个不错的起点。

Create a "grid," a non-symmetrical grid most likely, on a dialog or Form. Then populate it with irregular shaped images as you choose. If you need more space look into a Scrollable “whatever,” view, dialog, etc.

Irregular or non rectangular shaped bitmaps seems a good place to start.

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