• 大小: 81KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-11-15
  • 语言: C/C++
  • 标签: c++  图像处理  

资源简介

c++图像处理 调节亮度,对比度,饱和度等

资源截图

代码片段和文件信息

// BrightnessDialog.cpp : 实现文件
//

#include “stdafx.h“
#include “Photo.h“
#include “EffectDialog.h“


// CBrightnessDialog 对话框

IMPLEMENT_DYNAMIC(CBrightnessDialog CEffectDialog)

CBrightnessDialog::CBrightnessDialog(CWnd* pParent /*=NULL*/)
: CEffectDialog(CBrightnessDialog::IDD pParent)
{

}

CBrightnessDialog::~CBrightnessDialog()
{
}

void CBrightnessDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX IDC_BRIGHTNESS m_ctrlBrightness);
}


BEGIN_MESSAGE_MAP(CBrightnessDialog CEffectDialog)
ON_WM_HSCROLL()
END_MESSAGE_MAP()


// CBrightnessDialog 消息处理程序

BOOL CBrightnessDialog::OnInitDialog()
{
CEffectDialog::OnInitDialog();
m_ctrlBrightness.SetRange(-100100);
m_ctrlBrightness.SetPos(0);
m_ctrlBrightness.SetTicFreq(5);

return TRUE;  // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}

void CBrightnessDialog::OnHScroll(UINT nSBCode UINT nPos CScrollBar* pScrollBar)
{
if((CWnd*)&m_ctrlBrightness==pScrollBar)
{
BOOL bEffect=TRUE;
int nRealPos;
switch(nSBCode)
{
case SB_THUMBPOSITION:   
case SB_THUMBTRACK: 
nRealPos=nPos;
break;
case SB_PAGERIGHT:
case SB_PAGELEFT:
nRealPos=m_ctrlBrightness.GetPos();
break;
default:
bEffect=FALSE;
}
if(bEffect)
{
if(nPos==0)
::memcpy(&m_ColorMatrix&g_ColorMatrixsizeof(ColorMatrix));
else
{
float fValue=(int)nPos/200.0f;
m_ColorMatrix.m[4][0]=fValue;
m_ColorMatrix.m[4][1]=fValue;
m_ColorMatrix.m[4][2]=fValue;
}
// TRACE(_T(“%f\n“)fValue);
HDC hDC=::GetDC(m_hWnd);
Effect(hDC);
::ReleaseDC(m_hWndhDC);

}
}
CEffectDialog::OnHScroll(nSBCode nPos pScrollBar);
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1801  2008-04-02 10:13  Photo\BrightnessDialog.cpp

     文件      11023  2008-04-03 08:08  Photo\ChildView.cpp

     文件       1841  2008-04-01 17:04  Photo\ChildView.h

     文件       2215  2008-04-01 11:51  Photo\ColorBalanceDialog.cpp

     文件       1900  2008-04-01 14:00  Photo\ContrastDialog.cpp

     文件       2650  2008-04-01 14:09  Photo\EffectDialog.cpp

     文件       2901  2008-04-01 11:27  Photo\EffectDialog.h

     文件        602  2008-03-30 11:00  Photo\ImageFile.cpp

     文件        707  2008-03-30 11:00  Photo\ImageFile.h

     文件       2620  2008-04-01 16:53  Photo\MainFrm.cpp

     文件        834  2008-03-29 21:32  Photo\MainFrm.h

     文件      53980  2008-04-01 16:54  Photo\Photo.aps

     文件       1711  2008-04-01 16:53  Photo\Photo.cpp

     文件        470  2008-03-29 21:23  Photo\Photo.h

     文件      12913  2008-04-01 16:54  Photo\Photo.rc

     文件      10704  2008-03-31 11:00  Photo\Photo.rc.bak

     文件        874  2008-03-29 21:23  Photo\Photo.sln

    ..A..H.     78336  2008-04-03 17:02  Photo\Photo.suo

     文件       6277  2008-04-01 14:09  Photo\Photo.vcproj

     文件       1403  2008-04-03 17:02  Photo\Photo.vcproj.JKQ.JuKeqin.user

     文件       2625  2008-03-29 21:23  Photo\ReadMe.txt

     文件      61440  2008-04-03 08:08  Photo\Release\Photo.exe

     文件      12918  2008-03-31 14:16  Photo\res\bitmap1.bmp

     文件       7782  2008-04-01 16:51  Photo\res\Photo.ico

     文件        361  2008-03-29 21:23  Photo\res\Photo.rc2

     文件        958  2008-04-01 16:42  Photo\res\Toolbar.bmp

     文件       1922  2008-04-01 16:53  Photo\resource.h

     文件       1421  2008-03-31 11:11  Photo\resource.h.bak

     文件       1798  2008-03-31 13:49  Photo\RotateFilpDialog.cpp

     文件        586  2008-03-31 11:18  Photo\RotateFilpDialog.h

............此处省略9个文件信息

评论

共有 条评论