📄 cvcview.cpp
字号:
// cvcView.cpp : implementation of the CCvcView class
//
#include "stdafx.h"
#include "cvc.h"
#include "HistDlg.h"
#include "cvcDoc.h"
#include "cvcView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCvcView
IMPLEMENT_DYNCREATE(CCvcView, CView)
BEGIN_MESSAGE_MAP(CCvcView, CView)
//{{AFX_MSG_MAP(CCvcView)
ON_COMMAND(ID_ERZHI, OnErzhi)
ON_COMMAND(ID_HUIDUHUA, OnHuiduhua)
ON_COMMAND(ID_FUSHI, OnFushi)
ON_COMMAND(ID_BYTIQU, OnBytiqu)
ON_COMMAND(ID_BALINYUHUA, OnBalinyuhua)
ON_COMMAND(ID_PENGZHANG, OnPengzhang)
ON_COMMAND(ID_ddddd, Onddddd)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCvcView construction/destruction
CCvcView::CCvcView()
{
// TODO: add construction code here
}
CCvcView::~CCvcView()
{
}
BOOL CCvcView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CCvcView drawing
void CCvcView::OnDraw(CDC* pDC)
{
CCvcDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
if (pDoc->mm.IsValid())
pDoc->mm.ShowImage(pDC->GetSafeHdc(),10,10);
//tempimage1.ShowImage(pDC->GetSafeHdc(),10,10);
//char ss[33];
//char c[9];
//itoa(pDoc->mm.NumColors(),c,9);
//pDC->TextOut(23,23,c);
}
/////////////////////////////////////////////////////////////////////////////
// CCvcView printing
BOOL CCvcView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CCvcView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CCvcView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CCvcView diagnostics
#ifdef _DEBUG
void CCvcView::AssertValid() const
{
CView::AssertValid();
}
void CCvcView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CCvcDoc* CCvcView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCvcDoc)));
return (CCvcDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCvcView message handlers
void CCvcView::OnErzhi()
{
// TODO: Add your command handler code here
CCvcDoc *pDoc=GetDocument();
pDoc->mm.ErZhi(40);
pDoc->UpdateAllViews(NULL);
}
void CCvcView::OnHuiduhua()
{
CCvcDoc *pDoc=GetDocument();
pDoc->mm.HuiDuHua();
pDoc->UpdateAllViews(NULL);
}
void CCvcView::OnFushi()
{
// TODO: Add your command handler code here
CCvcDoc *pDoc=GetDocument();
pDoc->mm.FuShi();
pDoc->UpdateAllViews(NULL);
}
void CCvcView::OnBytiqu()
{
// TODO: Add your command handler code here
CCvcDoc *pDoc=GetDocument();
pDoc->mm.BianYanTiQu();
pDoc->UpdateAllViews(NULL);
}
void CCvcView::OnBalinyuhua()
{
// TODO: Add your command handler code here
CCvcDoc *pDoc=GetDocument();
pDoc->mm.Four2eight();
pDoc->UpdateAllViews(NULL);
}
void CCvcView::OnPengzhang()
{
CCvcDoc *pDoc=GetDocument();
pDoc->mm.PengZhang();
pDoc->UpdateAllViews(NULL);
}
void CCvcView::Onddddd()
{
// TODO: Add your command handler code here
CCvcDoc *pDoc=GetDocument();
HistDlg pp;
for (int i=1;i<256;i++)
{
pp.bhist[i]=0;
for (int m=1;m<pDoc->mm.GetWidth();m++)
{
for(int n=1;n<pDoc->mm.GetHeight();n++)
{
if(pDoc->mm.GetBlueValue(m,n)==i)
pp.bhist[i]+=1;
}
}
}
if(IDOK==pp.DoModal())
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -