本文整理汇总了C++中CData::GetBusInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CData::GetBusInfo方法的具体用法?C++ CData::GetBusInfo怎么用?C++ CData::GetBusInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CData
的用法示例。
在下文中一共展示了CData::GetBusInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawLine
void CSimplePanelDlg::DrawLine()
{
if(0 >= m_vecData.size())
return;
CDC* pDC = GetDC();
int nSize = 0;
m_vecData.size() < m_vecMemDC.size() ? nSize = (int)m_vecData.size() : nSize = (int)m_vecMemDC.size();
for (int ii = 0; ii < 6; ii++)
{
int nIndexData = ii;
//显示下一屏的数据,如果不够显示当前屏的
(ii + m_nIndexShow * 6) >= (int)m_vecData.size() ? nIndexData : nIndexData = ii + m_nIndexShow * 6;
CEsayMemDC* pMemDC = m_vecMemDC[ii];
CRect& rc = pMemDC->GetMemRect();
Gdiplus::Graphics gr(pMemDC->GetDC());
if(nIndexData < m_vecData.size())
{
CData* pData = m_vecData[nIndexData];
vector<BusArrivalInfo> vecArrival;
pData->GetBusInfo(vecArrival);
DrawArrive(gr, vecArrival, rc, pData);
}
else
DrawEmpty(gr, rc);
pMemDC->BltMem(*pDC);
}
ReleaseDC(pDC);
}
示例2: ChangeLine
void CSimplePanelDlg::ChangeLine()
{
int nLineCount = m_vecData.size();
m_nIndexShow++;
if((m_nIndexShow * 6 > nLineCount) || (m_nIndexShow * 6 - nLineCount == 0))
m_nIndexShow = 0;
if(nLineCount <= 6)
return;
//先计算当前有多少条线路要翻页的
int nTmpMemDCCount = 6;
nLineCount % 4 == 0 ? nTmpMemDCCount : nTmpMemDCCount = nLineCount % 6;
CDC* pDC = GetDC();
//创建临时的内存画布
vector<CEsayMemDC*> vecTemMemDC;
for(int ii = 0; ii < nTmpMemDCCount; ii++)
{
CEsayMemDC* pMemDC = m_vecMemDC[ii];
CEsayMemDC* pTmpMemDC = new CEsayMemDC(*pDC, pMemDC->GetMemRect());
vecTemMemDC.push_back(pTmpMemDC);
}
//将下一页的数据画到内存画布中
for(int ii = 0; ii < nTmpMemDCCount; ii++)
{
CData* pData = m_vecData[ii+m_nIndexShow*6];
vector<BusArrivalInfo> vecArrive;
pData->GetBusInfo(vecArrive);
CEsayMemDC* pTmpMemDC = vecTemMemDC[ii];
Gdiplus::Graphics gr(pTmpMemDC->GetDC());
DrawArrive(gr, vecArrive, pTmpMemDC->GetMemRect(), pData);
}
//两张画布切换动画
for(int ii = 0; ii < nTmpMemDCCount; ii++)
{
CEsayMemDC* pMemDC = m_vecMemDC[ii];
CEsayMemDC* pTmpMemDC = vecTemMemDC[ii];
CRect rc(0, 0, pMemDC->GetMemRect().Width(), pMemDC->GetMemRect().Height());
MoveUpDown(&pMemDC->GetDC(), &pTmpMemDC->GetDC(), pMemDC->GetMemRect(), pDC);
//pMemDC->BltMem(*pDC);
//pTmpMemDC->BltMem(*pDC);
delete pTmpMemDC;
}
//将临时的内存画布更新到原本的内存画布中
ReleaseDC(pDC);
}