views::Background
来源:互联网 发布:windows ad域组策略 编辑:程序博客网 时间:2024/04/20 12:58
class Background {
public:
Background();
virtual ~Background();
// Creates a background that fills the canvas in the specified color.
static Background* CreateSolidBackground(const SkColor& color);
// Creates a background that fills the canvas in the specified color.
static Background* CreateSolidBackground(int r, int g, int b) {
return CreateSolidBackground(SkColorSetRGB(r, g, b));
}
// Creates a background that fills the canvas in the specified color.
static Background* CreateSolidBackground(int r, int g, int b, int a) {
return CreateSolidBackground(SkColorSetARGB(a, r, g, b));
}
// Creates a background that contains a vertical gradient that varies
// from |color1| to |color2|
static Background* CreateVerticalGradientBackground(const SkColor& color1,
const SkColor& color2);
// Creates Chrome's standard panel background
static Background* CreateStandardPanelBackground();
// Creates a Background from the specified Painter. If owns_painter is
// true, the Painter is deleted when the Border is deleted.
static Background* CreateBackgroundPainter(bool owns_painter,
Painter* painter);
// Render the background for the provided view
virtual void Paint(gfx::Canvas* canvas, View* view) const = 0;
// Set a solid, opaque color to be used when drawing backgrounds of native
// controls. Unfortunately alpha=0 is not an option.
void SetNativeControlColor(SkColor color);
#if defined(OS_WIN)
// TODO(port): Make GetNativeControlBrush portable (currently uses HBRUSH).
// Get the brush that was specified by SetNativeControlColor
HBRUSH GetNativeControlBrush() const { return native_control_brush_; };
#endif // defined(OS_WIN)
private:
#if defined(OS_WIN)
// TODO(port): Create portable replacement for HBRUSH.
HBRUSH native_control_brush_;
#endif // defined(OS_WIN)
DISALLOW_COPY_AND_ASSIGN(Background);
};
提代了很多static函数来创建Background,Background本身一个抽象类,有两个实现类分别是SolidBackground、BackgroundPainter,主要的实现接口是:virtual void Paint(gfx::Canvas* canvas, View* view) const
因此,此类的功能是画View的背景。
- views::Background
- Android ApiDemos示例解析(150):Views->Layouts->LinearLayout->10. Background Image
- background
- background
- background
- BackGround
- background
- background
- background
- background
- Background
- background
- background
- Background
- views::RepeatController
- views::Border
- views::LayoutManager
- save views
- asp.net中的窗体身份验证(完整篇之三:用户登录页面)
- views::RepeatController
- snprintf函数使用(Windows与Linux版本)
- 线程同步:CriticalSection关键区域
- 简历要怎样写呢?面试要注意哪些细节?
- views::Background
- Applet与Servlet通信的具体实现 (转载)
- VML学习笔记
- views::Border
- Introducing the Class Interface
- 调用ext 的顺序问题
- java语言执行外部命令
- Google的九条创新原则
- Oracle相关好书推荐