📄 splash.cpp
字号:
// Splash.cpp : implementation file
//
#include "stdafx.h"
#include "imgproc.h"
#include "Splash.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSplashWnd
CSplashWnd::CSplashWnd()
{
}
CSplashWnd::~CSplashWnd()
{
}
BEGIN_MESSAGE_MAP(CSplashWnd, CWnd)
//{{AFX_MSG_MAP(CSplashWnd)
ON_WM_CREATE()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSplashWnd diagnostics
#ifdef _DEBUG
void CSplashWnd::AssertValid() const
{
CWnd::AssertValid();
}
void CSplashWnd::Dump(CDumpContext& dc) const
{
CWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSplashWnd message handlers
BOOL CSplashWnd::Create(CWnd* pParentWnd/*=NULL*/)
{
// TODO: Add your specialized code here and/or call the base class
if(! m_bitmap.LoadBitmap(IDB_SPLASH1))//load bitmap
return FALSE;
return CreateEx(0,AfxRegisterWndClass(0,//create window
AfxGetApp()->LoadStandardCursor(IDC_ARROW)),NULL,
WS_POPUP|WS_VISIBLE,0,0,800,600,pParentWnd->GetSafeHwnd(),NULL);
}
int CSplashWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CenterWindow();
return 0;
}
void CSplashWnd::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CDC dcImage;
if(! dcImage.CreateCompatibleDC(&dc))//create cdc
return;
//drew bitmap
CBitmap* pOldBitmap=dcImage.SelectObject(&m_bitmap);
dc.BitBlt(0,0,800,600,&dcImage,0,0,SRCCOPY);
dcImage.SelectObject(pOldBitmap);
// Do not call CWnd::OnPaint() for painting messages
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -