📄 ftpclientview.cpp
字号:
// ftpclientView.cpp : implementation of the CFtpclientView class
//
#include "stdafx.h"
#include "ftpclient.h"
#include "ftpclientDoc.h"
#include "ftpclientView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFtpclientView
IMPLEMENT_DYNCREATE(CFtpclientView, CView)
BEGIN_MESSAGE_MAP(CFtpclientView, CView)
//{{AFX_MSG_MAP(CFtpclientView)
ON_WM_ERASEBKGND()
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CFtpclientView construction/destruction
CFtpclientView::CFtpclientView()
{
// TODO: add construction code here
}
CFtpclientView::~CFtpclientView()
{
}
BOOL CFtpclientView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CFtpclientView drawing
void CFtpclientView::OnDraw(CDC* pDC)
{
CFtpclientDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CFtpclientView printing
BOOL CFtpclientView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CFtpclientView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CFtpclientView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CFtpclientView diagnostics
#ifdef _DEBUG
void CFtpclientView::AssertValid() const
{
CView::AssertValid();
}
void CFtpclientView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CFtpclientDoc* CFtpclientView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CFtpclientDoc)));
return (CFtpclientDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFtpclientView message handlers
BOOL CFtpclientView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP2);
CDC dcCompatible;
dcCompatible.CreateCompatibleDC(pDC);
//创建与当前DC(pDC)兼容的DC,先用dcCompatible准备图像,再将数据复制到实际DC中
dcCompatible.SelectObject(&bitmap);
CRect rect;
GetClientRect(&rect);//得到目的DC客户区大小,GetClientRect(&rect);
//得到目的DC客户区大小,
//pDC->BitBlt(0,0,rect.Width(),rect.Height(),&dcCompatible,0,0,SRCCOPY);//实现1:1的Copy
BITMAP bmp;//结构体
bitmap.GetBitmap(&bmp);
pDC->StretchBlt(0,0,rect.Width(),rect.Height(),&dcCompatible,0,0,
bmp.bmWidth,bmp.bmHeight,SRCCOPY);
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -