CClientDC hdc(this);//获取DC CPen pen(PS_SOLID,4,RGB(255,0,0));//创建一支红笔 CPen * pOldPen=hdc.SelectObject(&pen);//将笔选入DC中; //------------具体操作 MoveToEx(hdc,0,0,NULL); LineTo(hdc,104,210); //------------ hdc.SelectObject(pOldPen); //将旧笔重新选入到DC
CClientDC hdc(this);//获取DC CPen pen(PS_SOLID,4,RGB(255,0,0));//创建一支红笔 CPen * pOldPen=hdc.SelectObject(&pen);//将笔选入DC中; //------------具体操作 MoveToEx(hdc,0,0,NULL); LineTo(hdc,104,210); //------------ hdc.SelectObject(pOldPen); //将旧笔重新选入到DC