ui->setupUi(this);
QString StrWidth,StrHeigth;
QString filename="C:\\me\\myimage.jpg";
QImage* img=new QImage;
QImage* scaledimg=new QImage;//分别保存原图和缩放之后的图片
// QImage image;
if(! ( img->load(filename) ) ) //加载图像
{
QMessageBox::information(this,
tr("打开图像失败"),
tr("打开图像失败!"));
delete img;
return;
}
int Owidth=img->width(),Oheight=img->height();
int Fwidth,Fheight; //缩放后的图片大小
ui->label_text->setGeometry(0,0,400,300);
int Mul; //记录图片与label大小的比例,用于缩放图片