Draw three parallel lines of pixels
You have control over the drawing process down to the individual pixel level.
Listing 3 uses a for loop and calls the putpixel function three times in succession:
Listing 3. Draw three parallel lines of pixels.
for(int cnt = 0;cnt < 400;cnt += 3){ putpixel(screen,cnt,400-cnt,makecol(255,0,0));; putpixel(screen,cnt-1,400-cnt-1,makecol(0,255,0)); putpixel(screen,cnt+1,400-cnt+1,makecol(0,0,255)); }//end for loop |
Only every third pixel is drawn along each line leaving the pixels in between their original color.