资 源 简 介
Use Qt in image development.
QPixmap largepixmap;
QPixmap smallpixmap;
QPixmap maskpixmap;
QPixmap zoompixmap;
QPoint offset(0,0);
QPoint dragpos(150,150);
QPoint set(90,50);
//加载图片:
largepixmap.load("Images\MainGui.png");
smallpixmap = largepixmap.scaled(largepixmap.size()/1.2);
maskpixmap.load("Images\MainGui.png");
//绘制底层图片(非放大镜区域图案):
QPainter painter(this);
painter.drawPixmap(offset,smallpixmap);
painter.end();
//计算放大区域圆形的半径及所占矩形面积
int dim = qMin(width(), height());
int magnifierSize = dim * 5 / 6;
int radius = magnifierSize / 2;
int ring = radius - 15;
QSize box = QSize(magnifierSize, magnifierSize);