Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

alphablend_painter

The alphablend_painter draws another painter semi-transparent. It's very similar to transparent_painter. The only difference is that transparent_painter draws a specified color in another painter totally transparent while alphablend_painter draws the whole painter transparent. The transparency degree can be modified - 0 means totally transparent (invisible) and 255 means opaque (that's exactly the same as background_wnd's built-in transparency feature)

namespace win32 { namespace gui {

     class alphablend_painter : public painter_base, public painter_holder
     {    
     public:
          typedef unsigned param0;

          // c'tor
          alphablend_painter(unsigned transparency);

          // virtual functions of painter_base
          alphablend_painter* clone() const;
          void draw(HDC hDC, int cx, int cy);

          // own functions
          void transparency(unsigned transparency);
          unsigned transparency() const;
     };

} }  // namespace win32::gui

Note:
Example:
// create the alphablend_painter
const unsigned TRANSPARENCY = 100;
alphablend_painter p_alpha(TRANSPARENCY);
p_alpha.set_painter<ipicture_painter> ("c:\\img1.jpg");

// add the painter
add_painter (p_alpha);

The result is as follows
alphablend_painter.jpg



by Steven Weiss. You can contact me at steven11@gmx.de.