MCPcopy Create free account
hub / github.com/AgoraIO/API-Examples / OnPaint

Method OnPaint

windows/APIExample/APIExample/AGVideoTestWnd.cpp:51–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void CAGVideoTestWnd::OnPaint()
52{
53 // TODO: add message handle code here
54 CPaintDC dc(this);
55
56 CRect rcClient;
57
58 GetClientRect(&rcClient);
59 dc.FillSolidRect(0, 0, rcClient.Width(), rcClient.Height(), m_crBackColor);
60
61 dc.FillSolidRect(0, 0, m_nVolbarWidth, rcClient.Height(), m_crVolbarBackColor);
62 dc.FillSolidRect(rcClient.Width() - m_nVolbarWidth, 0, m_nVolbarWidth, rcClient.Height(), m_crVolbarBackColor);
63
64 int nMarkCount = rcClient.Height() / 5;
65 int nTopPoint = m_nCurVol*nMarkCount / m_nVolRange;
66
67 for (int nIndex = 0; nIndex < nMarkCount; nIndex++) {
68 if (nIndex <= nTopPoint) {
69 dc.FillSolidRect(0, rcClient.bottom - 5 * nIndex - 3, m_nVolbarWidth, 3, m_crVolbarBusyColor);
70 dc.FillSolidRect(rcClient.Width() - m_nVolbarWidth, rcClient.bottom - 5 * nIndex - 3, m_nVolbarWidth, 3, m_crVolbarBusyColor);
71 }
72 else {
73 dc.FillSolidRect(0, rcClient.bottom - 5 * nIndex - 3, m_nVolbarWidth, 3, m_crVolbarFreeColor);
74 dc.FillSolidRect(rcClient.Width() - m_nVolbarWidth, rcClient.bottom - 5 * nIndex - 3, m_nVolbarWidth, 3, m_crVolbarFreeColor);
75 }
76 }
77}
78
79
80void CAGVideoTestWnd::SetVolRange(int nRange)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected