WinAPI 控件显示图像

发布于 2024-10-09 12:12:27 字数 98 浏览 0 评论 0原文

Windows API 中有显示图像的 GUI 控件吗?我考虑过 STATIC 类,但它只适用于 bmp 文件,我需要 png、bmp、jpg 等来使用它。而且我不喜欢手动绘制图像。

Is there a GUI control that displays an image in the Windows API? I have considered the STATIC class but it only works on bmp files, and I need png, bmp, jpg, etc to work with it. And I prefer not to draw the image manually.

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

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

发布评论

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

评论(2

携君以终年 2024-10-16 12:12:27

您可以使用ListView,并使用LVM_SETBKIMAGE 设置背景图像。另一种选择是使用 GDI+ 并自己手动绘制,这也很简单。

You can use a ListView, and set the background image using LVM_SETBKIMAGE. Another option is to use GDI+ and draw it yourself manually, which is also pretty simple.

陈甜 2024-10-16 12:12:27

从 Windows Vista 开始,静态控件可以显示位图、图标或图元文件。
检查STM_SETIMAGE窗口消息,不要忘记设置正确的窗口样式。当然,微软又搞砸了,正如你从资源泄漏说明中看到的那样——要小心。

From Windows Vista the static control can display a bitmap, icon or metafile.
Check the STM_SETIMAGE window message and dont forget to set the correct window style. Of course Microsoft fucked it up again as you can see from the resource leak note - be carefull.

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