标签:point float height draw div value let cpe amp
void CMyPicoTestDlg::DrawWave(CDC *pDC,CRect &rectPicture) { float fDeltaX; float fDeltaY; int nX; int nY; CPen newPen; CPen *pOldPen; CBrush newBrush; CBrush *pOldBrush; fDeltaX=(float)rectPicture.Width()/(POINT_COUNT-1); fDeltaY=(float)rectPicture.Height()/80; newBrush.CreateSolidBrush(RGB(0,0,0)); pOldBrush=pDC->SelectObject(&newBrush); pDC->Rectangle(rectPicture); pDC->SelectObject(pOldBrush); newBrush.DeleteObject(); newPen.CreatePen(PS_SOLID,1,RGB(0,255,0)); pOldPen=pDC->SelectObject(&newPen); pDC->MoveTo(rectPicture.left,rectPicture.bottom); for (int i=0;i<POINT_COUNT;i++) { nX=rectPicture.left+(int)(i*fDeltaX); nY=rectPicture.bottom-(int)(m_nzValue[i]*fDeltaY); pDC->MoveTo(nX,rectPicture.bottom); pDC->LineTo(nX,nY); } pDC->SelectObject(pOldPen); newPen.DeleteObject(); }
标签:point float height draw div value let cpe amp
原文地址:https://www.cnblogs.com/qiwu1314/p/9024696.html