namespace win32 { namespace gui { class transparent_painter : public painter_base, public painter_holder { public: typedef COLORREF param0; // c'tor transparent_painter(COLORREF crTransparent); // virtual functions of painter_base transparent_painter* clone() const; void draw(HDC hDC, int cx, int cy); // own functions void transparent_color(COLORREF crTransparent); COLORREF transparent_color() const; }; } } // namespace win32::gui
set_painter() transparent_color() sets and returns the color which is transparent// transparent color COLORREF cr_white = RGB(255, 255, 252); // create transparent_painter transparent_painter p_transparent(cr_white); p_transparent.set_painter<tile_resource_painter> (bg_wnd::res_info(IDI_BACKGROUND_WND, IMAGE_ICON)); // add the transparent_painter and draw. also set bk-color so that we can recognize the effect better ;-) add_painter(p_transparent); bk_color(RGB(150, 0, 0));
The result is as follows
|
by Steven Weiss. You can contact me at steven11@gmx.de. |