From d75ac0afcc21375081000cbcb3bee763c90c8d08 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sat, 6 Sep 2003 15:39:06 +0000 Subject: get image from drawable --- src/FbTk/FbDrawable.cc | 9 ++++++++- src/FbTk/FbDrawable.hh | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/FbTk/FbDrawable.cc b/src/FbTk/FbDrawable.cc index 7a1cc9b..21f2eba 100644 --- a/src/FbTk/FbDrawable.cc +++ b/src/FbTk/FbDrawable.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbDrawable.cc,v 1.1 2003/04/29 08:49:36 fluxgen Exp $ +// $Id: FbDrawable.cc,v 1.2 2003/09/06 15:39:06 fluxgen Exp $ #include "FbDrawable.hh" @@ -86,4 +86,11 @@ void FbDrawable::drawPoint(GC gc, int x, int y) { XDrawPoint(FbTk::App::instance()->display(), drawable(), gc, x, y); } +XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const { + return XGetImage(FbTk::App::instance()->display(), drawable(), + x, y, width, height, + AllPlanes, // plane mask + ZPixmap); +} + }; // end namespace FbTk diff --git a/src/FbTk/FbDrawable.hh b/src/FbTk/FbDrawable.hh index 71a1ec3..30c7371 100644 --- a/src/FbTk/FbDrawable.hh +++ b/src/FbTk/FbDrawable.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbDrawable.hh,v 1.2 2003/05/10 13:28:11 fluxgen Exp $ +// $Id: FbDrawable.hh,v 1.3 2003/09/06 15:39:06 fluxgen Exp $ #ifndef FBTK_FBDRAWABLE_HH #define FBTK_FBDRAWABLE_HH @@ -49,6 +49,8 @@ public: virtual void drawPoint(GC gc, int x, int y); + virtual XImage *image(int x, int y, unsigned int width, unsigned int height) const; + /// X drawable virtual Drawable drawable() const = 0; virtual unsigned int width() const = 0; -- cgit v0.11.2