MFC界面画图

void CTest11Dlg::OnPaint() 
{

	CPaintDC dc(this); dc.TextOut(50,50,"sjkdgg");
	 dc.Rectangle(0,0,500,500);

         dc.MoveTo(5,5); 
          dc.LineTo(5,100);

		  
		  
		  
		  dc.MoveTo(5,5); 
		   dc.LineTo(100,5);
		   dc.MoveTo(5,5); 
		   dc.LineTo(100,100);

		   CString str;
		   for (int i=0;i<=10;i++)
		   {
			   str.Format("%d",i);

			   dc.TextOut(2,360-30*i-5,str );
			   dc.MoveTo(25,360-30*i);
			   dc.LineTo(20,360-30*i);
		   }
		   dc.MoveTo(350,357);
		   dc.LineTo(360,360);
		   dc.LineTo(350,363);
void CTest11Dlg::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default

	
	CDialog::OnLButtonDown(nFlags, point);

	CString str,ss,s;
	


	str.Format("%d",point.x);
    ss.Format("%d",point.y);
    UpdateData(FALSE);
	ss+=str;

    //CDialog::OnMouseMove(nFlags, point);
    MessageBox(ss);
	


	/*
	CPoint pt;
    ::GetCursorPos(&pt);
	str.Format("%d",pt.x);
	ss.Format("%d",pt.y);
	
    s='('+str+','+ss+')';*/

}


你可能感兴趣的:(MFC界面画图)