Write a simple transparent bitmap class, sometimes for the program to Polish a lot of the following is a program I wrote the UI, personally feel quite interesting.
Figure One appearance
This class can be inserted into any program, it provides a unified interface, the interface function to receive the image of the resource index number, long, wide 3 parameters. Of course, you can also add a pointer parameter to the parent window to determine the object create behavior and to specify which parent window the image represents should be attached to.
Writing this class requires familiarity with the use of CRGN classes. Refer to MSDN for specific information, such as member functions Combinergn and SetWindowRgn.
So well, here's what we'll do to create this class step by step.
First, you have to prepare an image to be displayed on the UI, define a transparent color, use the color to fill the transparent part, note here, the transparent color should be the color of the image is the least, but also note that transparent and non-transparent junction must be clear, there can be no transition color. Here I am using RGB (255, 0,255). As follows:
Figure Two Transparent bitmap