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

📄 lens.h

📁 MFC 函数实用手册
💻 H
字号:
#pragma once
#include <afxwin.h>

class CLens
{
public:
	CLens(HBITMAP hSrcBmp, HDC hDesDC);
	CLens(void);
	~CLens(void);

	// 成员变量

	HBITMAP m_hBmp;			// 背景源位图
	HDC m_hDC;				// 位图显示的设备上下文
	int m_nRadii;			// 透镜的半径
	int m_nDepth;			// 透镜的深度
	//bool m_bRound;			// 透镜是否为圆形
	//bool m_bConvex;			// 透镜是否为凸透镜
	int m_nBmpX;			// 位图输出的左上角的X坐标
	int m_nBmpY;			// 位图输出的左上角的Y坐标

protected:

	HBITMAP hBmpBuf;		// 中间临时位图
    WORD* pData;			// 位图数据指针
	WORD* pDataBuf;			// 中间临时位图数据缓冲区指针
	//WORD* pLens;			// 透镜区域扭曲部分数据指针
	//WORD* pLensBuf;			// 透镜区域源位图部分数据指针
	int nBmpW;				// 位图宽度
	int nBmpH;				// 位图高度
	int nBytes;				// 位图数据占的字节数
	int nBufBytes;			// 缓冲区数据所占字节数
	int nBits;				// 位图的位数

	int LastX,LastY;		// 透镜上一次的坐标

	HDC hMemBufDC;
	HDC hMemDC;				// 内存DC
	double* Rates;
	// 成员函数
public:

	bool SelectBitmap(HBITMAP hSrcBmp);
	bool SelectBitmap(CBitmap* pSrcBmp);
	bool SelectDC(HDC hDesDC);
	bool SelectDC(CDC* pDesDC);
	void Init();
	void Refraction(int x, int y, int oldx = -1, int oldy = -1);			// 折射
	BOOL CopyBitmap(int x = 0, int y = 0);

protected:
	long xy2Index(int x, int y);
};

⌨️ 快捷键说明

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