fill canvas easy script.
Posted: Mon May 16, 2011 5:54 pm
here, i was bored and made a script for a fill canvas function. just use..
in order to fill the canvas its put into.
its very simple, the j loop scans along the canvas, and everytime it moves 1 pixel its filled the height also (the i loop) placing a pixel at point i,j.
then i have a simple setpen to mark out the colour indicated in the function.
have fun
savvy
- Code: Select all
fill(R,G,B);
in order to fill the canvas its put into.
- Code: Select all
void fill (int R, int G, int B)
{
int i,j;
for(j=0;j<height;j++)
{
for(i=0;i<width;i++)
{
setpen(R,G,B,0,1);
putpixel(i,j);
}
}
}
its very simple, the j loop scans along the canvas, and everytime it moves 1 pixel its filled the height also (the i loop) placing a pixel at point i,j.
then i have a simple setpen to mark out the colour indicated in the function.
have fun
savvy