⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readbmpdlg.cpp

📁 WINCE实现
💻 CPP
字号:
// ReadBmpDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ReadBmp.h"
#include "ReadBmpDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CReadBmpDlg dialog

CReadBmpDlg::CReadBmpDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CReadBmpDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CReadBmpDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CReadBmpDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CReadBmpDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CReadBmpDlg, CDialog)
	//{{AFX_MSG_MAP(CReadBmpDlg)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CReadBmpDlg message handlers

BOOL CReadBmpDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	CenterWindow(GetDesktopWindow());	// center to the hpc screen

	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}



void CReadBmpDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
//	image.Load(dc.m_hDC ,L"\\time.bmp");
//	image.Draw (dc.m_hDC, 0, 0);
//	dc.Rectangle(0,0,10,10);
	m_DIBSection.Load(L"\\time.bmp");
//	m_DIBSection.Stretch(&dc, CPoint(0,0), CSize(240,160));

	CDC   *pMemDC;
	pMemDC=new   CDC; 
//selectObject

    pMemDC->CreateCompatibleDC(&dc);
	pMemDC->SelectObject(m_DIBSection.GetSafeHandle());   
	dc.StretchBlt(0,0,240,320,pMemDC,0,0,240,320,SRCCOPY);  
	delete   pMemDC;   

//	m_DIBSection.m_hBitmap
//	m_Bitmap
	// TODO: Add your message handler code here
 	
	// Do not call CDialog::OnPaint() for painting messages
}

void CReadBmpDlg::LoadBitmapFromFile(HINSTANCE   hInst,   LPTSTR   szFileName)
{


}

⌨️ 快捷键说明

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