正在加载图片...
void Floodfill(int x,int y,COLORREF oldvalue,COLORREF newvalue) /:(x,y)为种子oldvalue是原值 newvalue 是新值,应不等于原值。*/ if (GetPixel(x,y)==oldvalue) {SetPixel(x,y,newvalue);//赋值为新值 Floodfill(x,y-l,oldvalue,.newvalue);l/四向扩散 Floodfill(x,y+1,oldvalue,newvalue); Floodfill(x-1,y,oldvalue,newvalue); Floodfill(x+1,y,oldvalue,newvalue); void Floodfill(int x,int y,COLORREF oldvalue,COLORREF newvalue) /*(x,y)为种子 oldvalue是原值 newvalue 是新值,应不等于原值。*/ { if (GetPixel(x,y) == oldvalue) { SetPixel(x,y,newvalue);//赋值为新值 Floodfill(x,y-1,oldvalue,newvalue);//四向扩散 Floodfill(x,y+1,oldvalue,newvalue); Floodfill(x-1,y,oldvalue,newvalue); Floodfill(x+1,y,oldvalue,newvalue); } }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有