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

📄 bitmapex.cpp

📁 Displaying large amounts of technical data in a chart can be a frustrating task. You can find tons o
💻 CPP
字号:
// BitmapEx.cpp: Implementierung der Klasse CBitmapEx.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "BitmapEx.h"

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

IMPLEMENT_SERIAL( CBitmapEx, CBitmap, 1 )

void CBitmapEx::Serialize( CArchive& archive )
{
#ifndef _WIN32_WCE
	if (archive.IsStoring())
	{
		BITMAP bm;
		int nSize;
		GetObject (sizeof(BITMAP),&bm);
		archive << bm.bmType;
		archive << bm.bmWidth;
		archive << bm.bmHeight;
		archive << bm.bmWidthBytes;
		archive << bm.bmPlanes;
		archive << bm.bmBitsPixel;

		nSize = bm.bmWidthBytes * bm.bmHeight;

		if (bm.bmBits == NULL)
		{
			bm.bmBits = new BYTE[nSize];
			GetBitmapBits(nSize, bm.bmBits);
			archive.Write(bm.bmBits, nSize);
			delete bm.bmBits;
		}
		else
			archive.Write(bm.bmBits, nSize);
	}
	else
	{
		BITMAP bm;
		int nSize;
		archive >> bm.bmType;
		archive >> bm.bmWidth;
		archive >> bm.bmHeight;
		archive >> bm.bmWidthBytes;
		archive >> bm.bmPlanes;
		archive >> bm.bmBitsPixel;
		nSize = bm.bmWidthBytes * bm.bmHeight;
		bm.bmBits = new BYTE[nSize];
		archive.Read(bm.bmBits, nSize);
		CreateBitmapIndirect(&bm);
		delete bm.bmBits;

	}
#endif
}

⌨️ 快捷键说明

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