开发者

WinAPI Control to display image

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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜