使用Qt处理图片资源
代码说明:
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("ImagesMainGui.png"); smallpixmap = largepixmap.scaled(largepixmap.size()/1.2); maskpixmap.load("ImagesMainGui.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);
下载说明:请别用迅雷下载,失败请重下,重下不扣分!