G:\C++\polygonfill\polygonfillView.cpp(135) : error C2039: 'GetPixe1' : is not a member of 'CDC'
求各路编程大神帮一下忙!下面这个程序在程序里运行的时候下面提示出现这些错误,怎么解决啊?现G:\C++\polygonfill\polygonfillView.cpp(1...
求各路编程大神帮一下忙!下面这个程序在程序里运行的时候下面提示出现这些错误,怎么解决啊?现G:\C++\polygonfill\polygonfillView.cpp(135) : error C2039: 'GetPixe1' : is not a member of 'CDC'
void CPolygonfillView::OnMenuitem32774()
e:\软件\安装软件\c++6.0\mfc\include\afxwin.h(636) : see declaration of 'CDC'
下面是部分程序:
{ CDC *pDC; pDC=GetDC();
const N=8; int OldColor,GetColor;
int NewColor=0x00ff0000; int i,x, y,cx,cy;
long top ;
int P[N+1][2]={{100,150},{150,230},{200,160},{250,220},{300,160},
{250,80},{200,110},{160,70},
{100,150}};
typedef struct {int x,y;} POINT;
POINT stack[50000];
int Seedx=110,Seedy=150;
cx=P[0][0]; cy=P[0][1]; pDC->MoveTo(cx,cy);
for(i=1;i<=N;i++)
{ cx=P[i][0]; cy=P[i][1]; pDC->LineTo(cx,cy);
}
OldColor=pDC->GetPixe1(Seedx,Seedy);
pDC->SetPixe1(Seedx,Seedy,NewColor);
top=0;
stack[top].x=Seedx; stack[top++].y=Seedy;
while(top>0)
{ x=stack[--top].x;y=stack[top].y;
GetColor=pDC->GetPixe1(x-1,y);
if(GetColor==OldColor)
{pDC->SetPixe1(x-1,y,NewColor);
stack[top].x=x-1; stack[top++].y=y;
}
GetColor=pDC->GetPixe1(x+1,y);
if(GetColor==OldColor)
{pDC->SetPixe1(x+1,y,NewColor);
stack[top].x=x+1;stack[top++].y=y;
}
GetColor=pDC->GetPixe1(x,y-1);
if(GetColor==OldColor)
{pDC->SetPixe1(x,y-1,NewColor);
stack[top].x=x;stack[top++].y=y-1;
}
GetColor=pDC->GetPixe1(x,y+1);
if(GetColor==OldColor)
{pDC->SetPixe1(x,y+1,NewColor);
stack[top].x=x;stack[top++].y=y+1;
}
}
} 展开
void CPolygonfillView::OnMenuitem32774()
e:\软件\安装软件\c++6.0\mfc\include\afxwin.h(636) : see declaration of 'CDC'
下面是部分程序:
{ CDC *pDC; pDC=GetDC();
const N=8; int OldColor,GetColor;
int NewColor=0x00ff0000; int i,x, y,cx,cy;
long top ;
int P[N+1][2]={{100,150},{150,230},{200,160},{250,220},{300,160},
{250,80},{200,110},{160,70},
{100,150}};
typedef struct {int x,y;} POINT;
POINT stack[50000];
int Seedx=110,Seedy=150;
cx=P[0][0]; cy=P[0][1]; pDC->MoveTo(cx,cy);
for(i=1;i<=N;i++)
{ cx=P[i][0]; cy=P[i][1]; pDC->LineTo(cx,cy);
}
OldColor=pDC->GetPixe1(Seedx,Seedy);
pDC->SetPixe1(Seedx,Seedy,NewColor);
top=0;
stack[top].x=Seedx; stack[top++].y=Seedy;
while(top>0)
{ x=stack[--top].x;y=stack[top].y;
GetColor=pDC->GetPixe1(x-1,y);
if(GetColor==OldColor)
{pDC->SetPixe1(x-1,y,NewColor);
stack[top].x=x-1; stack[top++].y=y;
}
GetColor=pDC->GetPixe1(x+1,y);
if(GetColor==OldColor)
{pDC->SetPixe1(x+1,y,NewColor);
stack[top].x=x+1;stack[top++].y=y;
}
GetColor=pDC->GetPixe1(x,y-1);
if(GetColor==OldColor)
{pDC->SetPixe1(x,y-1,NewColor);
stack[top].x=x;stack[top++].y=y-1;
}
GetColor=pDC->GetPixe1(x,y+1);
if(GetColor==OldColor)
{pDC->SetPixe1(x,y+1,NewColor);
stack[top].x=x;stack[top++].y=y+1;
}
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询