📄 histogramdlg.h
字号:
#pragma once
#include "afxwin.h"
// CHistogramDlg 对话框
class CHistogramDlg : public CDialog
{
DECLARE_DYNAMIC(CHistogramDlg)
public:
CHistogramDlg(CWnd* pParent = NULL); // 标准构造函数
virtual ~CHistogramDlg();
// 对话框数据
enum { IDD = IDD_HISTOGRAM };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CStatic m_stiHistogram;//直方图显示区域
int m_nLimitLow;//显示灰度的下限
int m_nLimitUp;//显示灰度的上限
int m_nGray;//当前鼠标位置的灰度级数
float m_dPer;//出现概率
long m_lCounts[256];//各级灰度出现的个数
long m_nPixelCount;//图像像素总数
CPoint m_psMove;//记录拖动时的鼠标位置
int m_nIsDraging;//鼠标是否在拖动
public:
afx_msg void OnEnChangeLimitLower();
afx_msg void OnEnChangeLimitUp();
afx_msg void OnPaint();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
virtual BOOL OnInitDialog();
private:
void Refresh(void);//刷新直方图
//拖动枚举
enum DragingType{
DT_NULL,//无拖动
DT_LOW,//拖动下限
DT_UP//拖动上限
};
afx_msg void OnBnClickedCancel();
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -