Set color values for each pixel individually
Heart of program in Listing 2.
Listing 2 cycles through the screen bitmap setting the color values for each individual pixel.
Listing 2. Set color values for each pixel
individually.
for(int row = 0;row < 255;row++){
for(int column = 0;column < 255;column++){
putpixel(screen,column,row,makecol(column,row,128));
}//end loop row
}//end loop on column