【VC++】GetClientRect无法调用
1>e:\编程\c++\mfc应用程序\mfc1\draw.cpp(19):errorC2660:“GetClientRect”:函数不接受1个参数#include"st...
1>e:\编程\c++\mfc应用程序\mfc1\draw.cpp(19) : error C2660: “GetClientRect”: 函数不接受 1 个参数
#include "stdafx.h"
#include "math.h"
#include "const.h"
#include "Draw.h"
Draw::Draw()
{
}
void Draw::write(CDC* pDC)
{
switch (type){
case DRAW_LINE:
pDC->MoveTo(50,50);
pDC->LineTo(100,100);
break;
case DRAW_CURVE:
const unsigned int SEGMENTS=500;
CRect rect;
GetClientRect(&rect);
int nWidth=rect.Width();
int nHeight=rect.Height();
CPoint pt[SEGMENTS];
for (int i=0;i<SEGMENTS;i++){
pt[i].x=i*nWidth/SEGMENTS;
pt[i].y=(int)((nHeight/2)*(1-sin(2*PI*i/SEGMENTS)));
}
pDC->Polyline(pt,SEGMENTS);
}
} 展开
#include "stdafx.h"
#include "math.h"
#include "const.h"
#include "Draw.h"
Draw::Draw()
{
}
void Draw::write(CDC* pDC)
{
switch (type){
case DRAW_LINE:
pDC->MoveTo(50,50);
pDC->LineTo(100,100);
break;
case DRAW_CURVE:
const unsigned int SEGMENTS=500;
CRect rect;
GetClientRect(&rect);
int nWidth=rect.Width();
int nHeight=rect.Height();
CPoint pt[SEGMENTS];
for (int i=0;i<SEGMENTS;i++){
pt[i].x=i*nWidth/SEGMENTS;
pt[i].y=(int)((nHeight/2)*(1-sin(2*PI*i/SEGMENTS)));
}
pDC->Polyline(pt,SEGMENTS);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询