Image.cpp
Go to the documentation of this file.
00001  #include <QGraphicsScene>
00002  #include <QPainter>
00003  #include <QStyleOption>
00004 
00005  #include "Image.h"
00006 
00007  Image::Image()
00008  {
00009 
00010 
00011 
00012  }
00013 
00014 
00015  QRectF Image::boundingRect() const
00016  {
00017      qreal adjust = 2;
00018      int height = image.height();
00019      int width = image.width();
00020      return QRectF(0, 0,width + adjust, width + adjust);
00021  }
00022 
00023  void Image::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
00024  {
00025      painter->drawImage(0,0,image);
00026  }
00027 
00028  void Image::setImage(QImage& image)
00029  //set the QImage
00030  {
00031     this->image = image;
00032 
00033  }
00034 
00035 
00036  void Image::saveImage()
00037  {
00038 
00039      QString multifn;
00040      multifn ="../pictest.jpg";
00041 
00042      this->image.save(multifn,"JPG");
00043 
00044  }


corobot_teleop
Author(s): Morgan Cormier/Gang Li/mcormier@coroware.com
autogenerated on Tue Jan 7 2014 11:39:41