Now I wonder, how to draw a window taller than screensize:

When I'm using fl_offscreen, I can define a drawing area much taller 
than the real screen resolution and draw to it, using the 
fl_draw-functions. This works fine and I used it, to export png images 
of plots.

But this morning $BOSS was not happy, because he wanted to make a poster 
for an exhibition, but the screenshots of the software became too 
pixelated. Because of beeing a famous offscreen drawer, I minded this as 
no problem and tried to get an high resolution image of resized 
software. And failed. What do you think, how to achieve this?

It works to get the window by using fl_read_image() inside of draw, but 
this is limited to real screen resolution, because the window manager 
(GNOME/Fedora) sets the window to real resolution, when higher values 
had been set. So I tried to realise it offscreen like that:

enum { Off_w= 2000, Off_h= 3000 };

Fl_Offscreen OF=  fl_create_offscreen(Off_w, Off_h);
fl_begin_offscreen(OF);
pWindow->resize(0, 0, Off_w, Off_h);
pWindow->damage(0xFF);
pWindow->redraw();
pWindow->make_current();
pWindow->draw();                // was set to public
if (unsigned char* pImage= fl_read_image(0, 0, 0, Off_w, Off_h, 0))
{
        write_png("/home/ed/temp/image.png", pImage, Off_w, Off_h, 3);
        delete[] pImage;
}
fl_end_offscreen();
fl_delete_offscreen(OF);

The result is a black 2000x3000 pixel area, showing a part of the 
resized window at position of the original window. That means, the area 
that shows the window is same as on screen, but the content is enlarged 
(but cut off). What am I missing? Is there a better way to achieve this?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to