Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - fg_readbox http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                                fg_readbox

   Usage
   #include <fg.h>
   void char far fg_readbox(fg_const_pbox_t b, fg_color_t far *p);

   Description
   Read  box  b (inclusive) pixels off of the screen and store  into  the
   fg_color_t  array pointed to by p. The color of each pixel is  written
   into each element. The number of bytes required is  sizeof(fg_color_t)
   *  fg_box_area(b)  Rows are written first, in order  of  increasing  y
   (this means starting at the lower left corner).

   Example
   {
   fg_color_t *color_p;
   fg_box_t read_box;
   read_box [FG_X1] = 10;
   read_box [FG_Y1] = 0;
   read_box [FG_X2] = 100;
   read_box [FG_Y2] = 100;
   color_p = malloc(sizeof(fg_color_t) *
   fg_box_area(read_box));
   assert(color_p != NULL);
   fg_readbox(read_box, color_p);
   /* Need not be the same box, but must be the same size */

   read_box [FG_X1] += 20;
   read_box [FG_X2] += 20;
   read_box [FG_Y1] += 30;
   read_box [FG_Y2] += 30;
   fg_writebox(read_box, color_p);
   }


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson