Category : C Source Code
Archive   : C_ROTATE.ZIP
Filename : GRIDAREA.I

 
Output of file : GRIDAREA.I contained in archive : C_ROTATE.ZIP
/* Grid area for drawing pictures... */

#define MaxX 100
#define MaxY 100

class Box
{
private:
int x;
int y;
int size;
int color = BLACK;

public:
void create( int sx, int sy, int ss );
void draw( int cur_color );
void erase();
};

void Box::create( int sx, int sy, int ss )
{
x = sx;
y = sy;
size = ss;
}

void Box::draw( int cur_color )
{
if (color != cur_color)
{
color = cur_color;
gmouse.Mshow( FALSE );
setcolor( WHITE );
rectangle( x, y, x+size, y+size );
setfillstyle( SOLID_FILL, color );
floodfill( x+1, y+1, WHITE )
gmouse.Mshow( TRUE );
}
}

void Box::erase()
{
draw( BLACK );
}



class GridBox
{
private:
int grid_x;
int grid_y;
Box gb[MaxX][MaxY];

public:
create( int sx, int sy );
};

GridBox::create( int sx, int sy );
{
int i, j, xs, ys;
x = sx;
y = sy;

xs = 400 / x;
ys = 300 / y;
xs = xs > ys ? ys : xs;
for( i = 0; i < x; i++ )
for( j = 0; j < y; j++ )
gb[i][j].create( 150 + (i*xs), 0 + (i*xs), xs );
}




  3 Responses to “Category : C Source Code
Archive   : C_ROTATE.ZIP
Filename : GRIDAREA.I

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/