#include #include #include #include #include #define window_height 600 #define window_width 800 /*****************************************************************************/ /* This class provides a view to copy the offscreen surface to */ int color_map[window_width][window_height]; class My_Window : public Fl_Window{ int x,y,button; int handle(int e) { switch (e) { case FL_MOVE: x = Fl::event_x(); y = Fl::event_y(); std::cout<<"Postion X:"<< x <<" Postion Y:"<< y <(1), x(), y(), w(), h(), color); } public: Pixel(int x,int y,int w,int h,int RGB) : Fl_Widget(x,y,w,h,0) { this->color = fl_rgb_color((uchar)((RGB&0xff000000)>>24),(uchar)((RGB&0xff0000)>>16),(uchar)((RGB&0xff00)>>8)); } }; int main(int argc, char **argv) { for(int i=0;i<100;i++){ for (int j = 0; j < 100 ; j++) { color_map[i][j]=0xff000000; } } My_Window* window = new My_Window(window_width, window_height, "example"); window->begin(); for(int i=0;i<100;i++){ for (int j = 0; j < 100 ; j++) { new Pixel(i,j,1,1,color_map[i][j]); } } window->end(); window->show(argc,argv); return Fl::run(); } // main