get image from drawable
fluxgen fluxgen
2 files changed,
11 insertions(+),
2 deletions(-)
M
src/FbTk/FbDrawable.cc
→
src/FbTk/FbDrawable.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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"@@ -84,6 +84,13 @@ void FbDrawable::drawPoint(GC gc, int x, int y) {
if (drawable() == 0 || gc == 0) return; 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
M
src/FbTk/FbDrawable.hh
→
src/FbTk/FbDrawable.hh
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// 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@@ -48,6 +48,8 @@ virtual void fillPolygon(GC gc, XPoint *points, int npoints,
int shape, int mode); 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;