what I’m trying to do is to create chess game in C++ through WINAPI, and since I haven’t ever studied them at School I’m having some problems (online documentation is quite bad, I wasn’t able to find any example of how to do this) with printing an .ico file with transparency inside my window. I aldready managed to do it with a bitmap image but my Photoshop doesn’t let me save a .bmp file with alpha channels and I had to go for something supported by WINAPI and allowed transparency (therefore .ico).
My question is, how do you draw a transparent .ico file inside my window?
Thank you!
2
Answers
I got how to do it, I'll post the code:
But now I'm running into an additional problem: my icon is more than the double of 32x32 (it is 72x78) and my picture is getting aliased. Is there any way to solve this? Thanks!
If you are using icons from a resource file (resource.rc) you can load the icon with LoadIcon then get the Device contect of the dialog window and then draw it with DrawIconEx wherever you want for examlpe (x,y) = (10,10)