TpPen 类
V0.2.1TpUtils
2025-11-14
介绍
画笔工具类,用于定义绘图时的线条属性
基础信息
| 头文件: | include <TpPen.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | |
| 派生类: |
Public 成员函数
| TpPen() | 默认构造函数 | |
|---|---|---|
| TpPen(const TpPen &other) | 拷贝构造函数 | |
| TpPen(const TpColors &color) | ||
| TpPen(const TpColors &color, int32_t width) | ||
| ~TpPen() | 析构函数 | |
| Tp::PenStyle | style() const | 获取画笔样式 |
| setStyle(Tp::PenStyle style) | 设置画笔样式 | |
| dashOffset() const | 获取虚线偏移量 | |
| setDashOffset(float doffset) | 设置虚线偏移量 | |
| width() const | 获取画笔宽度 | |
| setWidth(int32_t width) | 设置画笔宽度 | |
| TpColors | color() const | 获取画笔颜色 |
| setColor(const TpColors &color) | 设置画笔颜色 | |
| Tp::PenCapStyle | capStyle() const | 获取线帽样式 |
| setCapStyle(Tp::PenCapStyle pcs) | 设置线帽样式 | |
| Tp::PenJoinStyle | joinStyle() const | 获取连接点样式 |
| setJoinStyle(Tp::PenJoinStyle pcs) | 设置连接点样式 | |
| setBrush(const TpBrush &brush) | 设置画笔的画刷;可以设置渐变等填充效果 | |
| TpBrush | brush() | 获取当前画笔画刷 |
| TpPen & TpPen::operator= | operator=(const TpPen &other) | 赋值运算符重载 |
成员函数说明
TpPen::TpPen()
默认构造函数...
默认构造函数
TpPen::TpPen(const TpPen &other)
拷贝构造函数...
拷贝构造函数
TpPen::TpPen(const TpColors &color)
暂无注释...
TpPen::TpPen(const TpColors &color, int32_t width)
暂无注释...
TpPen::~TpPen()
析构函数...
析构函数
Tp::PenStyle TpPen::style() const
获取画笔样式...
获取画笔样式
返回值:当前画笔样式 (实线/虚线等)
void TpPen::setStyle(Tp::PenStyle style)
设置画笔样式...
设置画笔样式
参数:style: 要设置的画笔样式
float TpPen::dashOffset() const
获取虚线偏移量...
获取虚线偏移量
返回值:当前虚线偏移量
void TpPen::setDashOffset(float doffset)
设置虚线偏移量...
设置虚线偏移量
参数:doffset: 新的虚线偏移量
int32_t TpPen::width() const
获取画笔宽度...
获取画笔宽度
返回值:当前画笔宽度(像素)
void TpPen::setWidth(int32_t width)
设置画笔宽度...
设置画笔宽度
参数:width: 新的画笔宽度(像素)
TpColors TpPen::color() const
获取画笔颜色...
获取画笔颜色
返回值:当前画笔颜色对象
void TpPen::setColor(const TpColors &color)
设置画笔颜色...
设置画笔颜色
参数:color: 新的颜色对象
Tp::PenCapStyle TpPen::capStyle() const
获取线帽样式...
获取线帽样式
返回值:当前线帽样式
void TpPen::setCapStyle(Tp::PenCapStyle pcs)
设置线帽样式...
设置线帽样式
参数:pcs: 新的线帽样式
Tp::PenJoinStyle TpPen::joinStyle() const
获取连接点样式...
获取连接点样式
返回值:当前连接点样式
void TpPen::setJoinStyle(Tp::PenJoinStyle pcs)
设置连接点样式...
设置连接点样式
参数:pcs: 新的连接点样式
void TpPen::setBrush(const TpBrush &brush)
设置画笔的画刷;可以设置渐变等填充效果...
设置画笔的画刷;可以设置渐变等填充效果
参数:brush: 画刷
TpBrush TpPen::brush()
获取当前画笔画刷...
获取当前画笔画刷
返回值:画刷
TpPen & TpPen::operator=(const TpPen &other)
赋值运算符重载...
赋值运算符重载
