Home > Back-end >  The C language
The C language

Time:09-26

 void IntegerBresenhamLine (int x0, int y0, int x1, int y1, int color) 
{
Int x, y, dx, dy, e;
Dx=x1 - x0, dy=y1 - y0, e=- dx;
X=x0, y=y0;
for(int i=0; I <=dx; I++)
{
Putpixel (x, y, color);
X++, e=e + 2 * dy;
If (e>=0) {y++, e=e - 2 * dx. }
}
}
  • Related