brentsplashex.cpp

来自「一个mapxmobile+gps的小程序,需要先安装mapx mobile」· C++ 代码 · 共 61 行

CPP
61
字号
// AntSplash.cpp

#include "stdafx.h"
#include "BrentSplashEx.h"
#include "..\resource.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

BEGIN_MESSAGE_MAP(CSplashWindow, CWnd)
  ON_WM_PAINT()
END_MESSAGE_MAP()

CSplashWindow::CSplashWindow()
{
	m_Bitmap.LoadBitmap(MAKEINTRESOURCE(IDB_BITMAP_LOGO));
	m_Bitmap.GetBitmap(&bmBitmap);
}

CSplashWindow::~CSplashWindow()
{
}

void CSplashWindow::CreateSplash(LPCTSTR szApp_Staring)
{
	CreateEx(0,
		     AfxRegisterWndClass(
			 0,
			 AfxGetApp()->LoadStandardCursor(IDC_UPARROW)),
			 szApp_Staring,
			 WS_POPUP,
			 0,
			 0,
			 bmBitmap.bmWidth,  //Bitmap Width = Splash Window Width
			 bmBitmap.bmHeight, //Bitmap Height = Splash Window Height
			 NULL,
			 NULL,
			 NULL);
}

void CSplashWindow::OnPaint()
{
	CPaintDC dc(this);
	memDC.CreateCompatibleDC(NULL);
	Old_Bitmap = memDC.SelectObject(&m_Bitmap);
	dc.StretchBlt(0,
				  0,
				  bmBitmap.bmWidth,
				  bmBitmap.bmHeight,   
				  &memDC,   
				  0,
				  0,
				  bmBitmap.bmWidth,    
				  bmBitmap.bmHeight,
				  SRCCOPY);
	memDC.SelectObject(Old_Bitmap);
	memDC.DeleteDC();
}

⌨️ 快捷键说明

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