VC中想坐标轴一运行就出来那画坐标轴的函数应放哪
voidCMyDlg::OnButton1(){//TODO:AddyourcontrolnotificationhandlercodehereCDC*pDC;text_...
void CMyDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CDC* pDC;
text_color=RGB(255,255,255);
SetTextColor(text_color);
GetClientRect(m_frameRect);
CRect rect;
w=10;h=5;
m_dataRect.left=m_frameRect.left+w*3;
m_dataRect.right=m_frameRect.right-w;
m_dataRect.top=m_frameRect.top+h;
m_dataRect.bottom=m_frameRect.bottom-h;
rect=m_dataRect;
CString str;
int i;
int m_left,m_top,m_right,m_bottom;
int m_Interval = 50;
m_dNum=m_Interval;
m_left = rect.left+20;
m_top = rect.top+10;
m_right = rect.right-10;
m_bottom = rect.bottom-40;
CPen* pPenRed = new CPen;
pPenRed->CreatePen(PS_SOLID, 1, RGB(255,0,0));
CGdiObject* pOldPen = pDC->SelectObject(pPenRed);
// 绘制坐标轴
pDC->MoveTo(m_left,m_top);
// 垂直轴
pDC->LineTo(m_left,m_bottom);
// 水平轴
pDC->LineTo(m_right,m_bottom);
}
编译通过了,但是坐标轴不出来,为什么 展开
{
// TODO: Add your control notification handler code here
CDC* pDC;
text_color=RGB(255,255,255);
SetTextColor(text_color);
GetClientRect(m_frameRect);
CRect rect;
w=10;h=5;
m_dataRect.left=m_frameRect.left+w*3;
m_dataRect.right=m_frameRect.right-w;
m_dataRect.top=m_frameRect.top+h;
m_dataRect.bottom=m_frameRect.bottom-h;
rect=m_dataRect;
CString str;
int i;
int m_left,m_top,m_right,m_bottom;
int m_Interval = 50;
m_dNum=m_Interval;
m_left = rect.left+20;
m_top = rect.top+10;
m_right = rect.right-10;
m_bottom = rect.bottom-40;
CPen* pPenRed = new CPen;
pPenRed->CreatePen(PS_SOLID, 1, RGB(255,0,0));
CGdiObject* pOldPen = pDC->SelectObject(pPenRed);
// 绘制坐标轴
pDC->MoveTo(m_left,m_top);
// 垂直轴
pDC->LineTo(m_left,m_bottom);
// 水平轴
pDC->LineTo(m_right,m_bottom);
}
编译通过了,但是坐标轴不出来,为什么 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询