00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #pragma once
00016 #include <background_wnd/painter_base.hpp>
00017
00018
00019 namespace win32 { namespace gui {
00020
00021 class gradient_painter : public painter_base
00022 {
00023 public:
00024 typedef std::pair<COLORREF, COLORREF> GradientColors;
00025 typedef const GradientColors& param0;
00026 typedef unsigned param1;
00027
00028
00029 gradient_painter(const GradientColors& colors, unsigned angle = 0);
00030
00031
00032 gradient_painter* clone() const;
00033 void draw(HDC hDC, int cx, int cy);
00034 bool is_opaque(int cx, int cy) const;
00035
00036
00037 void gradient_colors(const GradientColors& colors);
00038 GradientColors gradient_colors() const;
00039 void angle(unsigned angle);
00040 unsigned angle() const;
00041 static GradientColors make_gradient_colors(COLORREF crStart, COLORREF crEnd);
00042
00043 private:
00044 void draw_linear(HDC hDC, int cx, int cy, int r1, int g1, int b1, int r2, int g2, int b2);
00045
00046 GradientColors colors_;
00047 unsigned angle_;
00048 };
00049
00050 } }