// CDispCtrl.cpp : implementation file // #include "stdafx.h" #include "simulator.h" #include "DispCtrl.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDispCtrl CDispCtrl::CDispCtrl() { m_DispBuf = new COLORREF[DISP_WIDTH*DISP_HEIGHT]; for (int x=0; x< DISP_WIDTH; x++) for (int y=0; y< DISP_HEIGHT; y++) m_DispBuf[x+y*DISP_WIDTH] = 0; } CDispCtrl::~CDispCtrl() { delete m_DispBuf; } BEGIN_MESSAGE_MAP(CDispCtrl, CStatic) //{{AFX_MSG_MAP(CDispCtrl) ON_WM_PAINT() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDispCtrl message handlers void CDispCtrl::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here CDC *pDC = GetDC(); for (int x=0; x<96; x++) for (int y=0; y<64; y++) { pDC->SetPixel(x,y, m_DispBuf[x+y*DISP_WIDTH]); } // Do not call CStatic::OnPaint() for painting messages }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.