Am 08.05.2009 14:36 Uhr schrieb "Alvin" unter <[email protected]>:
> fl_color(FL_WHITE);
> fl_font(FL_TIMES, 15);
> fl_draw("Hello, World!", 25, 10);
> fl_end_offscreen();
>
> uchar *offscreenImage = new uchar[xdim * ydim * 3];
> fl_read_image(offscreenImage, x(), y(), xdim, ydim, 0);
>
The order of cals is wrong. After fl_end_offscreen(), no graphics context is
current anymore and fl_read_image does not know which context to read. This
should work correctly (assuming that fl_offscreen is fully and correctly
implemented on your platform):
> fl_color(FL_WHITE);
> fl_font(FL_TIMES, 15);
> fl_draw("Hello, World!", 25, 10);
> uchar *offscreenImage = new uchar[xdim * ydim * 3];
> fl_read_image(offscreenImage, x(), y(), xdim, ydim, 0);
> fl_end_offscreen();
>
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk