在OnDraw函数内定义后使用

使用时,要pDC->SelectObject(),如pDC->SelectObject(font);

 

CPen://draw line

Pen.CreatePen(PS_SOLID, 2, RGB(250, 0, 0));

pDC->MoveTo(x, y);//origin

pDC->LineTo(x, y);//destination

 

 

CBrush://draw shapes

Brush.CreateSolidBrush(RGB(50, 250, 0));

pDC->Rectangle(x1, y1, x2,y2);

 

CFont://draw characters

font.CreateFont(0, 0, 0, 0, 10/*字体颜色深浅*/, 0, 0, 0, OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, _T("楷体"));

CString showText;

showText.Format(_T("%d"),temp);

pDC->TextOut(x,y showText);

 

相关文章:

  • 2021-09-08
  • 2021-11-20
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-09-08
  • 2021-06-08
猜你喜欢
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2021-09-29
相关资源
相似解决方案