BCG的 BCGPGaugesDemo有众多仪表盘控件可以参考使用
编写时同ListCtrl一样 在停靠面板上加入仪表盘和动态曲线
主要代码
//插入CPU图形
pContainer->SetFillBrush(CBCGPBrush(
CBCGPColor(CBCGPColor::Silver, .), CBCGPColor::White, CBCGPBrush::BCGP_GRADIENT_RADIAL_BOTTOM_RIGHT));
pContainer->SetOutlineBrush(CBCGPBrush(CBCGPColor:: Gray)); m_pGaugeCPU = new CBCGPCircularGaugeImpl(pContainer);
// m_pGaugeCPU->SetRange(0., MAX_CPU); m_pGaugeCPU->SetRange(.,);
m_pGaugeCPU->SetMajorTickMarkStep();
m_pGaugeCPU->SetStep(); //m_pGaugeCPU->SetScaleRatio() m_pGaugeCPU->SetColors(CBCGPCircularGaugeColors::BCGP_CIRCULAR_GAUGE_WHITE);
m_pGaugeCPU->AddSubGauge(new CBCGPTextGaugeImpl(_T("幅度(mv)"), CBCGPColor::SteelBlue),
CBCGPGaugeImpl::BCGP_SUB_GAUGE_BOTTOM, CBCGPSize(, ), CBCGPPoint(, )); CBCGPBrush brRed(CBCGPColor::Firebrick, CBCGPColor::White, CBCGPBrush::BCGP_GRADIENT_DIAGONAL_LEFT);
m_pGaugeCPU->AddColoredRange(, , brRed, CBCGPBrush(), , .);
CBCGPBrush brGreen(CBCGPColor::Green, CBCGPColor::White, CBCGPBrush::BCGP_GRADIENT_DIAGONAL_LEFT);
m_pGaugeCPU->AddColoredRange(., ., brGreen, CBCGPBrush(), , .);