mgpixmap.cpp

来自「monqueror一个很具有参考价值的源玛」· C++ 代码 · 共 54 行

CPP
54
字号
#include "render_interface.h"#include "mgsize.h"#include "mgpixmap.h"MGPixmap::MGPixmap(){	loadOk = false;	memset( &bmp, 0, sizeof( bmp ) );}MGPixmap::~MGPixmap(){	if( loadOk )		UnloadBitmap( &bmp );}int MGPixmap::width() const{	return loadOk?bmp.bmWidth:0;}int MGPixmap::height() const{	return loadOk?bmp.bmHeight:0;}const MGBitmap* MGPixmap::mask() const{	// dont support	return 0;}MGSize MGPixmap::size() const{	return loadOk?MGSize( bmp.bmWidth, bmp.bmHeight ):MGSize(0,0);}void MGPixmap::resize( int w, int h ){	// dont support}void MGPixmap::resize( const MGSize& ){	// dont support}	bool MGPixmap::isNull() const{	if(!loadOk)return 1;			return bmp.bmBits == NULL;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?