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

📄 readme.wzd

📁 《Visual C++ MFC编程实例》配套代码,如果大家正在学习此教程
💻 WZD
字号:
/////////////////////////////////////////////////////////////////////
// Modify any class.
/////////////////////////////////////////////////////////////////////

// 1) to load bitmap from resource file
	CBitmap bitmap;
	bitmap.LoadBitmap(IDB_WZD);

// 2) to draw that bitmap to a device context
	CDC dcComp;
	dcComp.CreateCompatibleDC(pDC);
	dcComp.SelectObject(&bitmap);
	BITMAP bmInfo;
	bitmap.GetObject(sizeof(bmInfo),&bmInfo);
	pDC->BitBlt(0,0,bmInfo.bmWidth,bmInfo.bmHeight, &dcComp, 0,0,SRCCOPY);

// 3) to load bitmap directly from a file
	CBitmap bitmap;
	HBITMAP hbitmap = (HBITMAP)LoadImage(
		NULL,				// handle of the instance that contains the image
		"Wzd2.bmp",			// name or identifier of image
		IMAGE_BITMAP,		// type of image-- can also be IMAGE_CURSOR or IMAGE_ICON 
		0,0,				// desired width and height
		LR_LOADFROMFILE);	// load flags-- with LR_LOADTRANSPARENT makes transparent to bkgrnd
 
	bitmap.Attach(hbitmap);

// 4) draw as before



/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1998 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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