WMNMap::WMNMap(QWidget *parent) : QWidget(parent) { qsrand(QTime::currentTime().hour() * 3600 + QTime::currentTime().minute() * 60 + QTime::currentTime().second()); _Self = this; TrafficMap << 35 << 10 << 45 << 100 << 70 << 85 << 60 << 50; bzero(&inputParams, 0); haveInputParams = false; QPen redPen(Qt::red); redPen.setWidth(4); QPen bluePen(Qt::blue); bluePen.setWidth(4); QPen greenPen(Qt::green); greenPen.setWidth(4); QPen grayPen(Qt::gray); grayPen.setWidth(4); WMNArea = new QwtPlot(QwtText("Wireless Mesh Network Implementation")); // WMNArea->setAxisScale(0, 0, inputParams.squareArea); // WMNArea->setAxisScale(2, 0, inputParams.squareArea); curveMAP = new QwtPlotCurve("MAPs"); curveMAP->setRenderHint(QwtPlotItem::RenderAntialiased); curveMAP->setPen(redPen); curveMAP->setStyle(QwtPlotCurve::Dots); curveMAP->attach(WMNArea); curveMR = new QwtPlotCurve("MRs"); curveMR->setRenderHint(QwtPlotItem::RenderAntialiased); curveMR->setPen(bluePen); curveMR->setStyle(QwtPlotCurve::Dots); curveMR->attach(WMNArea); curveTP = new QwtPlotCurve("TPs"); curveTP->setRenderHint(QwtPlotItem::RenderAntialiased); curveTP->setPen(greenPen); curveTP->setStyle(QwtPlotCurve::Dots); curveTP->attach(WMNArea); curveDA = new QwtPlotCurve("MAPs"); curveDA->setRenderHint(QwtPlotItem::RenderAntialiased); curveDA->setPen(grayPen); curveDA->setStyle(QwtPlotCurve::Dots); curveDA->attach(WMNArea); QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(WMNArea); this->setLayout(layout); this->setWindowTitle(QTextCodec::codecForName("UTF8")->toUnicode("Сгенерированная WMN")); }
void CTriangle::SetRegion() { PointF* pPt = m_ptary.GetData(); int nWidth = m_nWidth; if(m_nWidth < 6) { nWidth = 6; } Pen greenPen(Color(255, 0, 255, 0), (float)nWidth); GraphicsPath path; path.AddPolygon(pPt,m_nPtCount); path.Widen(&greenPen); path.Outline(); m_Region.MakeEmpty(); m_Region.Union(&path); }
void CRectangle::SetRegion() { float left = min(m_ptary[0].X,m_ptary[1].X); float top = min(m_ptary[0].Y,m_ptary[1].Y); float width = fabs(m_ptary[0].X - m_ptary[1].X); float height = fabs(m_ptary[0].Y - m_ptary[1].Y); /*PointF* pPt = m_ptary.GetData();*/ int nWidth = m_nWidth; if(m_nWidth < 6) { nWidth = 6; } Pen greenPen(Color(255, 0, 255, 0), (float)nWidth); GraphicsPath path; if(RS_ROUND == m_nRStyle) { CRect rc((int)left,(int)top,(int)(left + width),(int)(top + height)); INT offsetX = (rc.right - rc.left) * 20/100; INT offsetY = (rc.bottom - rc.top) * 20/100; path.AddArc(rc.right - offsetX, rc.top, offsetX, offsetY, 270, 90); path.AddArc(rc.right - offsetX, rc.bottom - offsetY, offsetX, offsetY, 0, 90); path.AddArc(rc.left, rc.bottom - offsetY, offsetX, offsetY, 90, 90); path.AddArc(rc.left, rc.top, offsetX, offsetY, 180, 90); path.AddLine(rc.left + offsetX, rc.top, rc.right - offsetX/2, rc.top); } else { RectF rcf(left,top,width,height); path.AddRectangle(rcf); } path.Widen(&greenPen); path.Outline(); m_Region.MakeEmpty(); m_Region.Union(&path); }
void DlgHisto::OnPaint() { CPaintDC dc(this); // device context for painting CDemoDoc* pDoc = (CDemoDoc*) ((CMainFrame*)AfxGetMainWnd())->GetActiveFrame()->GetActiveDocument(); RECT r; GetClientRect(&r); CPen gridPen(PS_DOT,1,::GetSysColor(COLOR_APPWORKSPACE)); CPen* pOldPen = dc.SelectObject(&gridPen); for (int gx=9+32;gx<265;gx+=32){ dc.MoveTo(gx,40); dc.LineTo(gx,r.bottom - 6); } for (int gy=0;gy<(r.bottom - 40);gy+=((r.bottom - 40)/10)){ dc.MoveTo(8,r.bottom - 9 - gy); dc.LineTo(268,r.bottom - 9 - gy); } dc.SelectObject(pOldPen); CPen axisPen(PS_SOLID, 1, ::GetSysColor(COLOR_3DSHADOW)); pOldPen = dc.SelectObject(&axisPen); dc.MoveTo(9, 38); dc.LineTo(9, r.bottom - 9); dc.LineTo(266, r.bottom - 9); dc.LineTo(266, 38); dc.SelectObject(pOldPen); if (pDoc && pDoc->image) { if (pDoc->m_hmax){ int ybase = r.bottom-10; if (m_logen){ float yratio = (r.bottom - r.top - 50)/(float)log10((float)(pDoc->m_hmax+1)); if (m_ren){ CPen redPen(PS_SOLID, 1, RGB(222, 0, 0)); pOldPen = dc.SelectObject(&redPen); dc.MoveTo(10, (int)(ybase-log10((float)(1+pDoc->m_hr[0]))*yratio)); for (int x=1; x<256; x++) dc.LineTo(x+10, (int)(ybase-log10((float)(1+pDoc->m_hr[x]))*yratio)); } if (m_gen){ CPen greenPen(PS_SOLID, 1, RGB(0, 222, 0)); pOldPen = dc.SelectObject(&greenPen); dc.MoveTo(10, (int)(ybase-log10((float)(1+pDoc->m_hg[0]))*yratio)); for (int x=1; x<256; x++) dc.LineTo(x+10, (int)(ybase-log10((float)(1+pDoc->m_hg[x]))*yratio)); } if (m_ben){ CPen bluePen(PS_SOLID, 1, RGB(0, 0, 222)); pOldPen = dc.SelectObject(&bluePen); dc.MoveTo(10, (int)(ybase-log10((float)(1+pDoc->m_hb[0]))*yratio)); for (int x=1; x<256; x++) dc.LineTo(x+10, (int)(ybase-log10((float)(1+pDoc->m_hb[x]))*yratio)); } if (m_grayen){ CPen grayPen(PS_SOLID, 1, RGB(64, 64, 64)); pOldPen = dc.SelectObject(&grayPen); dc.MoveTo(10, (int)(ybase-log10((float)(1+pDoc->m_hgray[0]))*yratio)); for (int x=1; x<256; x++) dc.LineTo(x+10, (int)(ybase-log10((float)(1+pDoc->m_hgray[x]))*yratio)); } dc.SelectObject(pOldPen); } else { float yratio = (r.bottom - r.top - 50)/(float)pDoc->m_hmax; if (m_ren){ CPen redPen(PS_SOLID, 1, RGB(222, 0, 0)); pOldPen = dc.SelectObject(&redPen); dc.MoveTo(10, (int)(ybase-pDoc->m_hr[0]*yratio)); for (int x=1; x<256; x++) dc.LineTo(x+10, (int)(ybase-pDoc->m_hr[x]*yratio)); } if (m_gen){ CPen greenPen(PS_SOLID, 1, RGB(0, 222, 0)); pOldPen = dc.SelectObject(&greenPen); dc.MoveTo(10, (int)(ybase-pDoc->m_hg[0]*yratio)); for (int x=1; x<256; x++) dc.LineTo(x+10, (int)(ybase-pDoc->m_hg[x]*yratio)); } if (m_ben){ CPen bluePen(PS_SOLID, 1, RGB(0, 0, 222)); pOldPen = dc.SelectObject(&bluePen); dc.MoveTo(10, (int)(ybase-pDoc->m_hb[0]*yratio)); for (int x=1; x<256; x++) dc.LineTo(x+10, (int)(ybase-pDoc->m_hb[x]*yratio)); } if (m_grayen){ CPen grayPen(PS_SOLID, 1, RGB(64, 64, 64)); pOldPen = dc.SelectObject(&grayPen); dc.MoveTo(10, (int)(ybase-pDoc->m_hgray[0]*yratio)); for (int x=1; x<256; x++) dc.LineTo(x+10, (int)(ybase-pDoc->m_hgray[x]*yratio)); } dc.SelectObject(pOldPen); } } else { pDoc->m_hmax=pDoc->GetImage()->Histogram(pDoc->m_hr,pDoc->m_hg,pDoc->m_hb,pDoc->m_hgray); if (pDoc->m_hmax) Invalidate(); } } }
void CMidSubDrawHelper::drawHistoryBarData(CHistoryDataManager* pHistoryDataManager, QCustomPlot* pCustomPlot, QCPAxisRect* pRect) { QBrush redBrush(QColor(255, 0, 0, 255));//red QPen redPen(QColor(255, 0, 0, 255));//red QBrush greenBrush(QColor(0, 255, 0, 255));//green QPen greenPen(QColor(0, 255, 0, 255));//green QBrush* pBoxBrushRef = NULL; QPen* pBoxPenRef = NULL; QCPStatisticalBox *pStatisticalBoxRef = NULL; double fMinimum = 0; double fMaximum = 0; double fLowerQuartile = 0; double fUpperQuartile = 0; QMap<unsigned int, Bar>::iterator iterMap; int nIndex = 0; unsigned int nTimeFrom = 0; unsigned int nTimeTo = 0; double nLeftAxisRangeMin = 0; double nLeftAxisRangeMax = 0; int nBarWith = 0; nBarWith = pHistoryDataManager->getBarType();//FIVE_MINUTES nTimeFrom = pHistoryDataManager->getTimeFrom(); nTimeTo = pHistoryDataManager->getTimeTo(); // prepare axes: pRect->axis(QCPAxis::atLeft)->setLabel(QObject::tr("Y-value")); pRect->axis(QCPAxis::atBottom)->setLabel(QObject::tr("X-time")); pRect->axis(QCPAxis::atBottom)->setTickLabelType(QCPAxis::ltDateTime); pRect->axis(QCPAxis::atBottom)->setDateTimeFormat(DEF_STRING_FORMAT_TIME.c_str()); nIndex = 0; iterMap = pHistoryDataManager->m_pHistoryACK->m_MapBarData.begin(); while (iterMap != pHistoryDataManager->m_pHistoryACK->m_MapBarData.end()) { //iterMap->second; // create empty statistical box plottables: pStatisticalBoxRef = NULL; pStatisticalBoxRef = new QCPStatisticalBox(pRect->axis(QCPAxis::atBottom), pRect->axis(QCPAxis::atLeft)); pCustomPlot->addPlottable(pStatisticalBoxRef); fMinimum = iterMap->low; fMaximum= iterMap->high; if (iterMap->open > iterMap->close) { //high->low fLowerQuartile = iterMap->close; fUpperQuartile = iterMap->open; pBoxBrushRef = &redBrush; pBoxPenRef = &redPen; } else { fLowerQuartile = iterMap->open; fUpperQuartile = iterMap->close; pBoxBrushRef = &greenBrush; pBoxPenRef = &greenPen; } //boxBrush.setStyle(Qt::SolidPattern); // make it look oldschool Qt::SolidPattern Qt::Dense6Pattern pStatisticalBoxRef->setBrush(*pBoxBrushRef); pStatisticalBoxRef->setPen(*pBoxPenRef); pStatisticalBoxRef->setWhiskerPen(*pBoxPenRef); pStatisticalBoxRef->setWhiskerBarPen(*pBoxPenRef); pStatisticalBoxRef->setMedianPen(*pBoxPenRef); // set data: //pStatisticalBoxTmp->setKey(nIndex); pStatisticalBoxRef->setBoxType(QCPStatisticalBox::btBar); pStatisticalBoxRef->setKey(iterMap->timestamp); pStatisticalBoxRef->setMinimum(fMinimum); pStatisticalBoxRef->setLowerQuartile(fLowerQuartile); pStatisticalBoxRef->setMedian(fLowerQuartile); pStatisticalBoxRef->setUpperQuartile(fUpperQuartile); pStatisticalBoxRef->setMaximum(fMaximum); //pStatisticalBoxTmp->setWidth(1);//矩形宽度 pStatisticalBoxRef->setWidth(nBarWith);//矩形宽度 pStatisticalBoxRef->setWhiskerWidth(0);//上顶,下底 直线宽度 if (fMinimum < nLeftAxisRangeMin) { nLeftAxisRangeMin = fMinimum; } if (fMaximum > nLeftAxisRangeMax) { nLeftAxisRangeMax = fMaximum; } nIndex++; iterMap++; }//while // make key axis range scroll with the data (at a constant range size of 8): pRect->axis(QCPAxis::atBottom)->setRange(nTimeFrom, nTimeTo); pRect->axis(QCPAxis::atLeft)->setRange(nLeftAxisRangeMin, nLeftAxisRangeMax); // pCustomPlot->rescaleAxes(); // pCustomPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); pBoxBrushRef = NULL; pBoxPenRef = NULL; pStatisticalBoxRef = NULL; }
void QCompass::paintEvent(QPaintEvent *) { QPainter painter(this); QBrush bgGround(QColor(48,172,220)); QPen whitePen(Qt::white); QPen blackPen(Qt::black); QPen redPen(Qt::red); QPen bluePen(Qt::blue); QPen greenPen(Qt::green); whitePen.setWidth(1); blackPen.setWidth(2); redPen.setWidth(2); bluePen.setWidth(2); greenPen.setWidth(2); painter.setRenderHint(QPainter::Antialiasing); painter.translate(width() / 2, height() / 2); // draw background { painter.setPen(blackPen); painter.setBrush(bgGround); painter.drawEllipse(-m_size/2, -m_size/2, m_size, m_size); } // draw yaw lines { int nyawLines = 36; float rotAng = 360.0 / nyawLines; int yawLineLeng = m_size/25; double fx1, fy1, fx2, fy2; int fontSize = 8; QString s; blackPen.setWidth(1); painter.setPen(blackPen); for(int i=0; i<nyawLines; i++) { if( i == 0 ) { s = "N"; painter.setPen(bluePen); painter.setFont(QFont("", fontSize*1.3)); } else if ( i == 9 ) { s = "W"; painter.setPen(blackPen); painter.setFont(QFont("", fontSize*1.3)); } else if ( i == 18 ) { s = "S"; painter.setPen(redPen); painter.setFont(QFont("", fontSize*1.3)); } else if ( i == 27 ) { s = "E"; painter.setPen(blackPen); painter.setFont(QFont("", fontSize*1.3)); } else { s = QString("%1").arg(i*rotAng); painter.setPen(blackPen); painter.setFont(QFont("", fontSize)); } fx1 = 0; fy1 = -m_size/2 + m_offset; fx2 = 0; if( i % 3 == 0 ) { fy2 = fy1 + yawLineLeng; painter.drawLine(QPointF(fx1, fy1), QPointF(fx2, fy2)); fy2 = fy1 + yawLineLeng+4; painter.drawText(QRectF(-50, fy2, 100, fontSize+2), Qt::AlignCenter, s); } else { fy2 = fy1 + yawLineLeng/2; painter.drawLine(QPointF(fx1, fy1), QPointF(fx2, fy2)); } painter.rotate(-rotAng); } } // draw S/N arrow { int arrowWidth = m_size/5; double fx1, fy1, fx2, fy2, fx3, fy3; fx1 = 0; fy1 = -m_size/2 + m_offset + m_size/25 + 15; fx2 = -arrowWidth/2; fy2 = 0; fx3 = arrowWidth/2; fy3 = 0; painter.setPen(Qt::NoPen); painter.setBrush(QBrush(Qt::blue)); QPointF pointsN[3] = { QPointF(fx1, fy1), QPointF(fx2, fy2), QPointF(fx3, fy3) }; painter.drawPolygon(pointsN, 3); fx1 = 0; fy1 = m_size/2 - m_offset - m_size/25 - 15; fx2 = -arrowWidth/2; fy2 = 0; fx3 = arrowWidth/2; fy3 = 0; painter.setBrush(QBrush(Qt::red)); QPointF pointsS[3] = { QPointF(fx1, fy1), QPointF(fx2, fy2), QPointF(fx3, fy3) }; painter.drawPolygon(pointsS, 3); } // draw yaw marker { int yawMarkerSize = m_size/12; double fx1, fy1, fx2, fy2, fx3, fy3; painter.rotate(-m_yaw); painter.setBrush(QBrush(QColor(0xFF, 0x00, 0x00, 0xE0))); fx1 = 0; fy1 = -m_size/2 + m_offset; fx2 = fx1 - yawMarkerSize/2; fy2 = fy1 + yawMarkerSize; fx3 = fx1 + yawMarkerSize/2; fy3 = fy1 + yawMarkerSize; QPointF points[3] = { QPointF(fx1, fy1), QPointF(fx2, fy2), QPointF(fx3, fy3) }; painter.drawPolygon(points, 3); painter.rotate(m_yaw); } // draw altitude { int altFontSize = 13; int fx, fy, w, h; QString s; char buf[200]; w = 130; h = 2*(altFontSize + 8); fx = -w/2; fy = -h/2; blackPen.setWidth(2); painter.setPen(blackPen); painter.setBrush(QBrush(Qt::white)); painter.setFont(QFont("", altFontSize)); painter.drawRoundedRect(fx, fy, w, h, 6, 6); painter.setPen(bluePen); sprintf(buf, "ALT: %6.1f m", m_alt); s = buf; painter.drawText(QRectF(fx, fy+2, w, h/2), Qt::AlignCenter, s); sprintf(buf, "H: %6.1f m", m_h); s = buf; painter.drawText(QRectF(fx, fy+h/2, w, h/2), Qt::AlignCenter, s); } }
void GLCanvas::drawUserInterface(wxDC &dc) const { wxSize size = GetSize(); wxPoint pos(0, 0); pos.x = size.x - _buttonSize; wxSize buttonSize(_buttonSize, _buttonSize); wxPen whitePen(wxColour(255, 255, 255)); whitePen.SetWidth(1); wxPen blackPen(wxColour(0, 0, 0)); blackPen.SetWidth(1); wxPen greenPen(wxColour(0, 255, 0)); wxBrush brush; dc.SetPen(blackPen); brush.SetColour(wxColour(0, 0, 0)); dc.SetBrush(brush); // draw black background behind all buttons dc.DrawRectangle(pos.x - 1, pos.y, _buttonSize + 1, _numButtons * _buttonSize + 1); // draw grit if (_style & DRAW_GRID) { dc.SetPen(greenPen); } else { dc.SetPen(whitePen); } dc.DrawRectangle(pos.x + 1, pos.y + 1, _buttonSize - 2, _buttonSize - 2); dc.DrawLine(pos.x + _buttonSizeHalf, pos.y + 1, pos.x + _buttonSizeHalf, pos.y + _buttonSize - 1); dc.DrawLine(pos.x + 1, pos.y + _buttonSizeHalf, size.x - 1, pos.y + _buttonSizeHalf); pos.y += _buttonSize; // draw a cube for showing AABB if (_style & DRAW_AABB) { dc.SetPen(greenPen); } else { dc.SetPen(whitePen); } dc.DrawRectangle(pos.x + _buttonSizeHalf - 3, pos.y + 3, _buttonSizeHalf, _buttonSizeHalf); dc.DrawRectangle(pos.x + 2, pos.y + _buttonSizeHalf - 2, _buttonSizeHalf, _buttonSizeHalf); dc.DrawLine(pos.x + 2, pos.y + _buttonSizeHalf - 2, pos.x + _buttonSizeHalf - 3, pos.y + 3); dc.DrawLine(pos.x + 2 + _buttonSizeHalf, pos.y + _buttonSizeHalf - 2, pos.x + _buttonSize - 3, pos.y + 3); dc.DrawLine(pos.x + 2 + _buttonSizeHalf, pos.y + _buttonSize - 3, pos.x + _buttonSize - 3, pos.y + _buttonSizeHalf + 2); pos.y += _buttonSize; // draw coordinate system if (_style & DRAW_LOCAL_COORDINATE_SYSTEM) { dc.SetPen(greenPen); } else { dc.SetPen(whitePen); } dc.DrawLine(pos.x + 2, pos.y + 3, pos.x + 2, pos.y + _buttonSize - 2); dc.DrawLine(pos.x + 2, pos.y + _buttonSize - 2, size.x - 3, pos.y + _buttonSize - 2); dc.DrawLine(pos.x + 2, pos.y + _buttonSize - 2, pos.x + _buttonSize - 6, pos.y + _buttonSizeHalf + 2); pos.y += _buttonSize; // draw joint constraints if (_style & DRAW_JOINT_CONSTRAINTS) { dc.SetPen(greenPen); } else { dc.SetPen(whitePen); } //dc.DrawCircle(pos.x + _buttonSizeHalf, pos.y + _buttonSizeHalf, _buttonSizeHalf - 3); //dc.DrawArc(pos.x + 4, pos.y + 5, pos.x + 4, pos.y + _buttonSize - 5, pos.x + _buttonSizeHalf + 2, pos.y + _buttonSizeHalf); //dc.DrawCircle(pos.x + 6, pos.y + _buttonSizeHalf, 3); dc.DrawEllipse(pos.x + 4, pos.y + 3, _buttonSizeHalf - 5, _buttonSizeHalf + 4); dc.DrawLine(pos.x + 8, pos.y + 3, pos.x + _buttonSizeHalf + 5, pos.y + _buttonSizeHalf); dc.DrawLine(pos.x + 8, pos.y + _buttonSizeHalf + 7, pos.x + _buttonSizeHalf + 5, pos.y + _buttonSizeHalf); pos.y += _buttonSize; // draw rotation axis if (_style & DRAW_ROTATION_AXIS) { dc.SetPen(greenPen); } else { dc.SetPen(whitePen); } dc.DrawArc(pos.x + _buttonSizeHalf + 2, pos.y + _buttonSize - 2, pos.x + _buttonSizeHalf, pos.y + _buttonSizeHalf + 1, pos.x + 2, pos.y + _buttonSize - 2); //dc.DrawEllipse(pos.x + 6, pos.y + 5, _buttonSize - 12, _buttonSize - 10); //dc.DrawCircle(pos.x + _buttonSizeHalf + 2, pos.y + _buttonSizeHalf - 2, 3); dc.DrawLine(pos.x + 2, pos.y + _buttonSize - 2, pos.x + _buttonSize - 2, pos.y + 2); dc.DrawLine(pos.x + 2, pos.y + _buttonSize - 2, pos.x + _buttonSize - 2, pos.y + _buttonSize - 2); pos.y += _buttonSize; // draw label if (_style & DRAW_LABEL) { dc.SetPen(greenPen); } else { dc.SetPen(whitePen); } dc.DrawRoundedRectangle(pos.x + 4, pos.y + 3, _buttonSize - 5, _buttonSizeHalf, 3.0); dc.DrawSpline(pos.x + 4, pos.y + _buttonSizeHalf - 3, pos.x + 1, pos.y + _buttonSizeHalf + 4, pos.x + _buttonSizeHalf + 4, pos.y + _buttonSizeHalf + 6); pos.y += _buttonSize; // draw locate skeleton button dc.SetPen(whitePen); dc.DrawLine(pos.x + _buttonSizeHalf, pos.y + 2, pos.x + _buttonSizeHalf, pos.y + _buttonSize - 1); dc.DrawLine(pos.x + 2, pos.y + _buttonSizeHalf, size.x - 1, pos.y + _buttonSizeHalf); dc.DrawCircle(pos.x + _buttonSizeHalf, pos.y + _buttonSizeHalf, _buttonSizeHalf - 4); brush.SetColour(wxColour(255, 255, 255)); dc.SetBrush(brush); dc.DrawCircle(pos.x + _buttonSizeHalf, pos.y + _buttonSizeHalf, _buttonSizeHalf - 8); pos.y += _buttonSize; // draw settings button dc.DrawCircle(pos.x + _buttonSizeHalf, pos.y + _buttonSizeHalf, _buttonSizeHalf - 3); dc.SetPen(blackPen); brush.SetColour(wxColour(0, 0, 0)); dc.SetBrush(brush); dc.DrawCircle(pos.x + _buttonSizeHalf + 6, pos.y + _buttonSizeHalf, 2); dc.DrawCircle(pos.x + _buttonSizeHalf - 6, pos.y + _buttonSizeHalf, 2); dc.DrawCircle(pos.x + _buttonSizeHalf, pos.y + _buttonSizeHalf + 6, 2); dc.DrawCircle(pos.x + _buttonSizeHalf, pos.y + _buttonSizeHalf - 6, 2); dc.SetPen(whitePen); dc.DrawCircle(pos.x + _buttonSizeHalf, pos.y + _buttonSizeHalf, _buttonSizeHalf - 7); }