// SkinView.cpp : implementation file // #include "stdafx.h" //#include "dialog.h" #include "SkinView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSkinView CSkinView::CSkinView() { } CSkinView::~CSkinView() { } BEGIN_MESSAGE_MAP(CSkinView, CStatic) //{{AFX_MSG_MAP(CSkinView) ON_WM_PAINT() ON_WM_ERASEBKGND() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSkinView message handlers BOOL CSkinView::LoadBKImage(LPCTSTR szImagePath) { return m_bmpBK.LoadImage(szImagePath); } void CSkinView::OnPaint() { CPaintDC dc(this); // device context for painting CRect rcClient; GetClientRect(&rcClient); CEnBitmap bmp; if (m_bmpBK.m_hObject !=0) m_bmpBK.ExtendDraw(&dc,rcClient,5,5); //Ö»»­×óÓұ߿ò CPen pen(PS_SOLID,1,m_ViewBorder); CPen * oldPen=dc.SelectObject(&pen); dc.MoveTo(rcClient.left ,rcClient.top); dc.LineTo(rcClient.left ,rcClient.bottom ); dc.MoveTo(rcClient.right ,rcClient.top); dc.LineTo(rcClient.right ,rcClient.bottom ); dc.SelectObject(&oldPen); // Do not call CStatic::OnPaint() for painting messages } BOOL CSkinView::OnEraseBkgnd(CDC* pDC) { return TRUE; }