Albrecht Schlosser schrieb: > On 02.05.2012 15:51, Edzard Egberts wrote: > I don't think that this has anything to do with the screen_xywh() > functions. You're calling: > > Fl_Offscreen OF= fl_create_offscreen(1000, 1000); > fl_begin_offscreen(OF); > Fl_Window::draw(); // draws window off screen > fl_end_offscreen(); > > This creates a 1000x1000 pixel offscreen image and draws the window > contents into this image. However, your window has its own x/y > coordinates (based on its position on your workstation), and hence > all drawings are "translated" by these x/y coordinates. If your window > happens to be more than 1000 pixels shifted to the right or bottom, > nothing will be drawn /inside/ your offscreen image.
That would mean, when moving the window, it should change it's position on screenshot, shouldn't it? But it doesn't, it was always drawn starting at (0,0) and when window is leaving first screen, then parts on second screen are cut off. Anyway I just found out, that there is no offscreen drawing at all - the fl_read_image() always catches the whole window, not the part written inside of offscreen. When there is a part of the window covered by another window, this will be black in the screenshot. And it is not a Linux problem, because this test was made using MS-Windows. Is there a special way to connect fl_read_image() to offscreen buffer? Maybe the real problem comes from this function? Do I need some make_current()? But I'm using the offscreen inside of draw(), so drawing should work. > Unfortunately I don't understand what you're testing in your demo > program (how can you see whether you got a _valid_ image?), so I > can't it test myself... I'm testing, whether fl_read_image() returns a valid pointer, "Got Image!" when a pointer was returned, "No Image!" when pointer is zero. Okay, finally there is a funktion, that saves pointer as jpeg-image, but this part works: When there is an image, it will be saved and can be loaded and viewed. But the problem is, that often fl_read_image() doesn't deliver a pointer. _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

