diff options
| author | Manolo Gouy <Manolo> | 2011-04-15 21:38:05 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2011-04-15 21:38:05 +0000 |
| commit | 9ff9cf123046b64be860a48438566ed6a9f5c541 (patch) | |
| tree | e5d0ddae9a4d580082fba1c0f98190dc50595e4d /src/fl_read_image.cxx | |
| parent | c473215f2a1ac2659e92973ff9ecaf1579ffc313 (diff) | |
Added Fl_Paged_Device::print_window() to print a window with its title bar and frame.
Added Fl_Window::decorated_w() and Fl_Window::decorated_h() that return the size
of a window with its title bar and frame.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8593 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_read_image.cxx')
| -rw-r--r-- | src/fl_read_image.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fl_read_image.cxx b/src/fl_read_image.cxx index 9475e2ec9..9597005e1 100644 --- a/src/fl_read_image.cxx +++ b/src/fl_read_image.cxx @@ -92,6 +92,7 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate int X, // I - Left position int Y, // I - Top position int w, // I - Width of area to read + // negative allows capture of window title bar and frame int h, // I - Height of area to read int alpha) { // I - Alpha value for image (0 for none) XImage *image; // Captured image @@ -118,6 +119,8 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate // ReadDisplay extension which does all of the really hard work for // us... // + int allow_outside = w < 0; // negative w allows negative X or Y, that is, window frame + if (w < 0) w = - w; # ifdef __sgi if (XReadDisplayQueryExtension(fl_display, &i, &i)) { @@ -131,7 +134,10 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate // fetch absolute coordinates int dx, dy, sx, sy, sw, sh; Window child_win; - Fl_Window *win = fl_find(fl_window); + + Fl_Window *win; + if (allow_outside) win = (Fl_Window*)1; + else win = fl_find(fl_window); if (win) { XTranslateCoordinates(fl_display, fl_window, RootWindow(fl_display, fl_screen), X, Y, &dx, &dy, &child_win); |
