修改Bresenham使产生 虚线(待证)

Bresenham(int x1,int y1,int x2,int y2,COLORREF color,CDC *pDC){

           int x,y,dx,dy,p;

           x=x1;y=y1;dx=x2-x1;dy=-y2-y1;

          p=2*dy-dx;

          for(;x

                       pDC->SetPixel(x,y,color);

                       if(p>=0){

                                y+=2;

                                p+=4*(dy-dx);

                      }

                     else

                             p+=4*dy;

                       }

}

 

你可能感兴趣的:(修改Bresenham使产生 虚线(待证))