H
herald
Unregistered / Unconfirmed
GUEST, unregistred user!
// hex_jiamiView.cpp : implementation of the CHex_jiamiView class
//
[blue]#include "stdafx.h"
#include "hex_jiami.h"[/blue]
#include "hex_jiamiDoc.h"
#include "hex_jiamiView.h"
#include "c_post_bitmap.h"
#ifdef _DEBUG
// CHex_jiamiView
[h2]IMPLEMENT_DYNCREATE(CHex_jiamiView, CView)
begin
_MESSAGE_MAP(CHex_jiamiView, CView)
//{{AFX_MSG_MAP(CHex_jiamiView)[/h2]
ON_WM_LBUTTONDBLCLK()
ON_WM_CANCELMODE()
ON_WM_PAINT()
ON_WM_CAPTURECHANGED()
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView construction/destruction
CHex_jiamiView::CHex_jiamiView()
{
//this->post_bmp.base_point.x=1;
}
CHex_jiamiView::~CHex_jiamiView()
{
}
BOOL CHex_jiamiView:reCreateWindow(CREATESTRUCT&
cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView:reCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView drawing
void CHex_jiamiView::OnDraw(CDC* pDC)
{
CHex_jiamiDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView printing
BOOL CHex_jiamiView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return do
PreparePrinting(pInfo);
}
void CHex_jiamiView::Onbegin
Printing(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CHex_jiamiView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView diagnostics
#ifdef _DEBUG
void CHex_jiamiView::AssertValid() const
{
CView::AssertValid();
}
void CHex_jiamiView:ump(CDumpContext&
dc) const
{
CView:ump(dc);
}
CHex_jiamiDoc* CHex_jiamiView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CHex_jiamiDoc)));
return (CHex_jiamiDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView message handlers
void CHex_jiamiView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CView::OnCancelMode();
post_bmp.base_point.x=point.x;
post_bmp.base_point.y=point.y;
CView::OnPaint();
//CView::OnLButtonDblClk(nFlags, point);
//sleep(100);
CView::OnPaint();
}
void CHex_jiamiView::OnCancelMode()
{
}
void CHex_jiamiView::OnPaint()
{int xx,yy;
CPaintDC dc(this);
// device context for painting
// do
not call CView::OnPaint() for painting messages
}
void CHex_jiamiView::OnCaptureChanged(CWnd *pWnd)
{
// TODO: Add your message handler code here
CView::OnCaptureChanged(pWnd);
}
//
[blue]#include "stdafx.h"
#include "hex_jiami.h"[/blue]
#include "hex_jiamiDoc.h"
#include "hex_jiamiView.h"
#include "c_post_bitmap.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CHex_jiamiView
[h2]IMPLEMENT_DYNCREATE(CHex_jiamiView, CView)
begin
_MESSAGE_MAP(CHex_jiamiView, CView)
//{{AFX_MSG_MAP(CHex_jiamiView)[/h2]
ON_WM_LBUTTONDBLCLK()
ON_WM_CANCELMODE()
ON_WM_PAINT()
ON_WM_CAPTURECHANGED()
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView construction/destruction
CHex_jiamiView::CHex_jiamiView()
{
//this->post_bmp.base_point.x=1;
}
CHex_jiamiView::~CHex_jiamiView()
{
}
BOOL CHex_jiamiView:reCreateWindow(CREATESTRUCT&
cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView:reCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView drawing
void CHex_jiamiView::OnDraw(CDC* pDC)
{
CHex_jiamiDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView printing
BOOL CHex_jiamiView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return do
PreparePrinting(pInfo);
}
void CHex_jiamiView::Onbegin
Printing(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CHex_jiamiView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView diagnostics
#ifdef _DEBUG
void CHex_jiamiView::AssertValid() const
{
CView::AssertValid();
}
void CHex_jiamiView:ump(CDumpContext&
dc) const
{
CView:ump(dc);
}
CHex_jiamiDoc* CHex_jiamiView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CHex_jiamiDoc)));
return (CHex_jiamiDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CHex_jiamiView message handlers
void CHex_jiamiView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CView::OnCancelMode();
post_bmp.base_point.x=point.x;
post_bmp.base_point.y=point.y;
CView::OnPaint();
//CView::OnLButtonDblClk(nFlags, point);
//sleep(100);
CView::OnPaint();
}
void CHex_jiamiView::OnCancelMode()
{
}
void CHex_jiamiView::OnPaint()
{int xx,yy;
CPaintDC dc(this);
// device context for painting
代码:
CDC memDC;
memDC.CreateCompatibleDC(&dc);
memDC.SelectObject(this->post_bmp);
//////////////////
xx=post_bmp.base_point.x;
yy=post_bmp.base_point.y;
dc.BitBlt(xx,yy,89,132,&memDC,0,0,SRCCOPY);
not call CView::OnPaint() for painting messages
}
void CHex_jiamiView::OnCaptureChanged(CWnd *pWnd)
{
// TODO: Add your message handler code here
CView::OnCaptureChanged(pWnd);
}