全透明制作屏幕雪花效果
#include "pubbase.h"
#include "snownode.h"
#include <QSize>
#include <QPoint>
#include <QBitmap>
#include <QPixmap>
#include <QToolButton>
#include <QApplication>
#include <QDesktopWidget>
#include <QGraphicsScene>
#include <QGraphicsView>
const int SnowNode::MAXSWOW = 19;
SnowNode::SnowNode(QWidget *parent):
QToolButton(parent),m_animation(new QPropertyAnimation(this, "geometry"))
{
//必须设置为无边框,否则可见区域和图片绘制区域将出现不重叠
setWindowFlags( Qt::FramelessWindowHint );
resize(GetSnowSize());
//对图片进行缩放
m_pixmap.load(GetImgFileName());
m_pixmap = m_pixmap.scaled(this->size(),Qt::IgnoreAspectRatio);
setHidden(true);
m_areaSize.setWidth(QApplication::desktop()->width());
m_areaSize.setHeight(QApplication::desktop()->height());
}