?? lens.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 + -