位图类 更多...
#include <PixelMap.h>
Public 成员函数 | |
| PixelMap (const iSize &size=iSize()) | |
| 构造函数 | |
| PixelMap (const PixelMap &other) | |
| PixelMap (PixelMap &&other) | |
| ~PixelMap () | |
| PixelMap | clip (const iRect &rect) const |
| 从当前位图中裁剪出一个新的位图 | |
| PixelMap & | operator= (const PixelMap &other) |
| PixelMap & | operator= (PixelMap &&other) |
| void | saveToFile (const std::wstring &filename, bool withAlpha=false) const |
| 将位图保存到文件 | |
| void | setAlpha (int alpha) |
| 为位图的每个像素统一设置Alpha通道 | |
| iSize | size () const |
| 获取位图大小 | |
静态 Public 成员函数 | |
| static PixelMap | loadFromFile (const std::wstring &filename) |
| 加载位图文件 | |
| static PixelMap | loadFromWindow (const iRect &rect) |
| 从窗口中加载位图 | |
友元 | |
| class | Graphics |
| class | Texture |
位图类
| GFt::PixelMap::PixelMap | ( | const PixelMap & | other | ) |
| GFt::PixelMap::PixelMap | ( | PixelMap && | other | ) |
| GFt::PixelMap::~PixelMap | ( | ) |
|
static |
加载位图文件
| filename | 文件位置 |
支持的格式:PNG、BMP、JPG、GIF、EMF、WMF、ICO
| void GFt::PixelMap::saveToFile | ( | const std::wstring & | filename, |
| bool | withAlpha = false ) const |
将位图保存到文件
| filename | 文件名 |
支持的格式:PNG、BMP,其它的将保存为PNG
| withAlpha | 是否保存Alpha通道 |
| void GFt::PixelMap::setAlpha | ( | int | alpha | ) |
为位图的每个像素统一设置Alpha通道
| alpha | 新的Alpha值 |
| iSize GFt::PixelMap::size | ( | ) | const |
获取位图大小
|
friend |
|
friend |