diff -r 000000000000 -r 7a96bd401351 imageobj.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imageobj.cpp Sun Jan 30 12:58:47 2005 +0000 @@ -0,0 +1,100 @@ +#include "imageobj.h" + +///////////////////////////////////////////////////////////////// +// ImageObj +///////////////////////////////////////////////////////////////// +ImageObj::ImageObj( QCanvas *canvas ) + : QCanvasRectangle( canvas ) +{ +// cout << "Const ImageObj (canvas)\n"; + setZ(Z_ICON); + type=undef; +} + +ImageObj::~ImageObj() +{ +// cout << "Destr ImageObj\n"; +} + +void ImageObj::copy(ImageObj* other) +{ + setSize (other->width(), other->height() ); + setVisibility (other->isVisible() ); + type=other->type; +// if (type==qimage) + image=other->image; +// if (type==qpixmap) + pixmap=other->pixmap; +} + +void ImageObj::setVisibility (bool v) +{ + if (v) + show(); + else + hide(); +} + +void ImageObj::save(const QString &fn, const char *format) +{ + switch (type) + { + case undef: qWarning("undef");break; + case qimage: image.save (fn,format,-1);break; + case qpixmap: pixmap.save (fn,format,-1);break; + } +} + +bool ImageObj::load (const QString &fn) +{ + if (!image.load( fn) ) + //cout << "Fatal Error in ImageObj::load ("<