Program / DLG.H
Program / DLG.H
Program / DLG.H
/* Dlg.h */
#if !
defined(AFX_DLG_H__D203A2A4_25FC_4F93_83B1_A5979DCD502A__INC
LUDED_)
#define
AFX_DLG_H__D203A2A4_25FC_4F93_83B1_A5979DCD502A__INCLUDED
_
// CDlg dialog
// Dialog Data
//{{AFX_DATA(CDlg)
enum { IDD = IDD_DIALOG1 };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV
support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the
previous line.
#endif // !
defined(AFX_DLG_H__D203A2A4_25FC_4F93_83B1_A5979DCD502A__INC
LUDED_)
#include "stdafx.h"
#include "Bitmap.h"
#include "Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CDlg dialog
BEGIN_MESSAGE_MAP(CDlg, CDialog)
//{{AFX_MSG_MAP(CDlg)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// CDlg message handlers
BOOL CDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_copy.AutoLoad(IDC_BUTTON1,this);
m_cut.AutoLoad(IDC_BUTTON2,this);
m_paste.AutoLoad(IDC_BUTTON3,this);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlg::OnButton1()
{
choice=1;
Invalidate();
}
void CDlg::OnButton2()
{
choice=2;
Invalidate();
}
void CDlg::OnButton3()
{
choice=3;
Invalidate();
#include "stdafx.h"
#include "Bitmap.h"
#include "Dlg.h"
#include "BitmapDoc.h"
#include "BitmapView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CBitmapView
IMPLEMENT_DYNCREATE(CBitmapView, CView)
BEGIN_MESSAGE_MAP(CBitmapView, CView)
//{{AFX_MSG_MAP(CBitmapView)
//}}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()
return CView::PreCreateWindow(cs);
}
// CBitmapView drawing
CDlg d;
d.DoModal();
if(d.choice ==1)
{
CBitmap bmp;
if(bmp.LoadBitmap(&"COPYD"))
{
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bmp);
pDC->BitBlt(100,100,200,200,&dcMemory,0,0,SRCCOPY);
}
}
if(d.choice ==2)
{
CBitmap bmp;
if(bmp.LoadBitmap(&"CUTD"))
{
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bmp);
pDC->BitBlt(100,100,200,200,&dcMemory,0,0,SRCCOPY);
}
}
if(d.choice ==3)
{
CBitmap bmp;
if(bmp.LoadBitmap(&"PASTED"))
{
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bmp);
pDC->BitBlt(100,100,200,200,&dcMemory,0,0,SRCCOPY);
}
}
// CBitmapView printing
// CBitmapView diagnostics
#ifdef _DEBUG
void CBitmapView::AssertValid() const
{
CView::AssertValid();
}
/////////////////////////////////////////////////////////////////////////////
// CBitmapView message handlers
BITMAPS
COPYD COPYU
CUTD
CUTU
PASTED
PASTEU
OUTPUT