#include"Image/IntelliShapedImage.h" #include"IntelliHelper/IntelliHelper.h" #include #include #include IntelliShapedImage::IntelliShapedImage(int weight, int height) :IntelliImage(weight, height){ } IntelliShapedImage::~IntelliShapedImage(){ } QImage IntelliShapedImage::getDisplayable(const QSize& displaySize){ QImage copy = imageData; QPoint extrem(copy.width()+1, 0); QPoint startPoint(0,0); //traverse through y direction for(int y = 0; y not in Polygon if(!(cutNumber&1)){ QColor tmpColor(copy.color(y*copy.width()+x)); tmpColor.setAlpha(0); copy.setPixelColor(startPoint,tmpColor); } } } return copy.scaled(displaySize,Qt::IgnoreAspectRatio); } void IntelliShapedImage::setPolygon(const std::vector& polygonData){ this->polygonData=polygonData; return; }