// showwave.cpp : implementation file // #include "..\stdafx.h" #include "..\Client.h" #include "ShowWave.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CShowWave CShowWave::CShowWave() { m_nSize = 0; m_nBits = -1; m_hWnd = NULL; brush.CreateSolidBrush(GetSysColor(COLOR_3DFACE)); } CShowWave::~CShowWave() { } BEGIN_MESSAGE_MAP(CShowWave, CStatic) //{{AFX_MSG_MAP(CShowWave) ON_WM_PAINT() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CShowWave message handlers void CShowWave::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here ::GetClientRect(m_hWnd,rcClient); CBitmap Bitmap; CBitmap* pbmOld = NULL; CPen pen,*pOldPen; pen.CreatePen(PS_SOLID,1,RGB(172,168,153)); CDC dcMem; dcMem.CreateCompatibleDC(&dc); Bitmap.CreateCompatibleBitmap(&dc,rcClient.right,rcClient.bottom); pbmOld = dcMem.SelectObject(&Bitmap); dcMem.FillRect(rcClient,&brush); int x,y; if(m_nSize>0&&m_nBits>0) { if(m_nBits==8) { pOldPen = dcMem.SelectObject(&pen); dcMem.MoveTo(0,rcClient.bottom/2); for (x=0;x