---------------------------
Microsoft Visual C++
---------------------------
Unhandled exception in Draw.exe (MFC42D.DLL): 0xC00000FD: Stack Overflow.
---------------------------
确定
---------------------------
今天作了个区域填充函数,结果一测试发现上面的错误,程序如下:
DrawFilling(int x,int y,int fill_color,int boundary_color)
{
CClientDC dc(this);
dc.SetROP2(R2_NOT);
int c; c=dc.GetPixel(x,y); if((c!=boundary_color)&&(c!=fill_color))
{
//dc.SetPixel(x, y, fill_color);
DrawFilling(x, y+1, fill_color, boundary_color);
DrawFilling(x, y-1, fill_color, boundary_color);
DrawFilling(x+1,y, fill_color, boundary_color);
DrawFilling(x-1,y, fill_color, boundary_color);
}}有好的建议题题啊~~!
Microsoft Visual C++
---------------------------
Unhandled exception in Draw.exe (MFC42D.DLL): 0xC00000FD: Stack Overflow.
---------------------------
确定
---------------------------
今天作了个区域填充函数,结果一测试发现上面的错误,程序如下:
DrawFilling(int x,int y,int fill_color,int boundary_color)
{
CClientDC dc(this);
dc.SetROP2(R2_NOT);
int c; c=dc.GetPixel(x,y); if((c!=boundary_color)&&(c!=fill_color))
{
//dc.SetPixel(x, y, fill_color);
DrawFilling(x, y+1, fill_color, boundary_color);
DrawFilling(x, y-1, fill_color, boundary_color);
DrawFilling(x+1,y, fill_color, boundary_color);
DrawFilling(x-1,y, fill_color, boundary_color);
}}有好的建议题题啊~~!
解决方案 »
- 能告诉我一下COM技术的现状吗?
- 两种基本重画之间的效率问题
- CListCtrl的排序问题
- 有没有VC或者java实现的网络语音对讲的例子?
- 驱动如何获取芯片的ID
- 关于Indexing Samples的问题
- 怎么让程序一开始运行就打开一个特定的文件?
- 关于编写Active控件问题,请多指教!!100分,不够可以再加
- 为什么会报这样的错?error C2065: 'IDD_TEST_DIALOG' : undeclared identifier
- 用CString保存SQL语句时太长了放不下怎么办?
- OpenG中如何求屏幕顶角的光栅坐标
- 请问:为什么在DLL的线程中用的资源是调用这个DLL的应用程序资源,怎样指定用DLL的资源?
{
if(x<0 | x>x最大值 | y<0 | y>y最大值)
return;
CClientDC dc(this);
dc.SetROP2(R2_NOT);
int c;
你在其他地方定义再传进来。
DrawFilling(int x,int y,int fill_color,int boundary_color,CClientDC *dc)
{
if(x<0 | x>x最大值 | y<0 | y>y最大值)
return;
dc->SetROP2(R2_NOT);
int c;
c=dc->GetPixel(x,y); if((c!=boundary_color)&&(c!=fill_color))
{
//dc.SetPixel(x, y, fill_color);
DrawFilling(x, y+1, fill_color, boundary_color,dc);
DrawFilling(x, y-1, fill_color, boundary_color,dc);
DrawFilling(x+1,y, fill_color, boundary_color,dc);
DrawFilling(x-1,y, fill_color, boundary_color,dc);
}}