/种子填充算法voidCZhztchView::boundaryfill4(intx,inty,intboundarycolor,intnewcolor){intcolor;CClientDCdc(this);//获取客户区设备描述表color=dc
GetPixel(x,y);if(color
=newcolor&&color
=boundarycolor){dc
SetPixel(x,y,newcolor);boundaryfill4(x,y+1,boundarycolor,newcolor);boundaryfill4(x,y-1,boundarycolor,newcolor);boundaryfill4(x-1,y,boundarycolor,newcolor);boundaryfill4(x+1,y,boundarycolor,newcolor);}}//////////////////////////////////////////////////////////////////////////////////扫描线填充算法voidCZhztchView::OnScanfill(){RedrawWindow();CDC*pDC=GetDC();CPennewpen(PS_SOLID,3,RGB(255,0,0));CPen*old=pDC->SelectObject(&newpen);spt[0]=CPoint(100,100);//绘制多边形区域spt[1]=CPoint(300,100);spt[2]=CPoint(250,250);spt[3]=CPoint(100,250);spt[4]=CPoint(150,200);spt[5]=CPoint(90,180);spt[6]=CPoint(150,150);spt[7]=CPoint(100,100);