> In editior.cxx file . it is given provision to open a new > file , write & > save in file by capturing from keyboard . > > In simillar way I want to open new file , write & save in > specified file > by using mouse . > > I could able to draw on window but i don't know to saves the > current buffer > to the specified file . > > Can I use textbuffer for if image is drawn by using mouse ? > > Please help me in this regards
I am not sure what you are asking, but I think you are asking about making a "paint" program, where pixels drawn on the screen with the mouse will be stored to a file? If that is what you want, then textbuffer is not an appropriate widget to use. Rather, you would make your drawing widget out of (for example) an Fl_Box, then draw into that. Now you can either draw directly onto that widget, then when you want to save the image you could use fl_read_image(); to read back the pixel data for the image than simply store it using PNG or JPEG (both of which are provided with fltk) to a standard image file. However, fl_read_image(), used in this simple way, in effect reads directly from the screen, so if another window overlaps with your widget, then parts of that window might get read back too! Clearly, that's not going to be what you want... Better, then, is to draw your image in a buffer, perhaps an Fl_Offscreen for example, which you can blit to the display as necessary e.g. with fl_copy_offscreen(). Or perhaps manipulate your image in a buffer as "raw" pixels and copy them to the display via an Fl_RGB_Image, or similar. Again, in either case, you would use PNG to write your image buffer data to a file. SELEX Sensors and Airborne Systems Limited Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England & Wales. Company no. 02426132 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

