Imageview1.cpp
上传用户:aqingfeng
上传日期:2014-03-25
资源大小:1839k
文件大小:3k
- // Imageview1.cpp : implementation file
- //
- #include "stdafx.h"
- #include "小波变换.h"
- #include "Imageview1.h"
- #include "小波变换Doc.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CImageview
- IMPLEMENT_DYNCREATE(CImageview, CView)
- CImageview::CImageview()
- {
- }
- CImageview::~CImageview()
- {
- }
- BOOL CImageview::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- BEGIN_MESSAGE_MAP(CImageview, CView)
- //{{AFX_MSG_MAP(CImageview)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- 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()
- /////////////////////////////////////////////////////////////////////////////
- // CImageview drawing
- void CImageview::OnDraw(CDC* pDC)
- {
- BeginWaitCursor();
- CMyDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code here
- HDIB MulDIB=pDoc->m_hMulDIB;
- if (MulDIB!= NULL)
- {
- LPSTR lpDIB = (LPSTR) ::GlobalLock((HGLOBAL)MulDIB);
- // 获取DIB宽度
- int cxDIB = (int) ::DIBWidth(lpDIB);
- // 获取DIB高度
- int cyDIB = (int) ::DIBHeight(lpDIB);
- ::GlobalUnlock((HGLOBAL)MulDIB);
- CRect rcDIB;
- rcDIB.top = rcDIB.left = 0;
- rcDIB.right = cxDIB;
- rcDIB.bottom = cyDIB;
- // 输出DIB
- ::PaintDIB(pDC->m_hDC, &rcDIB, pDoc->m_hMulDIB,
- &rcDIB, NULL);
- }
- }
- BOOL CImageview::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CImageview::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CImageview::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CImageview diagnostics
- #ifdef _DEBUG
- void CImageview::AssertValid() const
- {
- CView::AssertValid();
- }
- void CImageview::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CMyDoc* CImageview::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyDoc)));
- return (CMyDoc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CImageview message handlers