I have a program that operates with larger images but displays smaller versions of these images. I cannot get the scaling to work properly, the result is always too large. Below is my code. Thanks.
//declare and make pixmap
map.fill(Qt::white);
//save pixmap
map.save("pic.bmp", 0, -1);
//scale and display pixmap
map=map.scaled(300, 200, Qt::IgnoreAspectRatio, Qt::FastTransformation);
pixmapLabel->setPixmap(map);
//declare and make pixmap
QPixmap map(600,400);
map.fill(Qt::white);
//save pixmap
map.save("pic.bmp", 0, -1);
//scale and display pixmap
map=map.scaled(300, 200, Qt::IgnoreAspectRatio, Qt::FastTransformation);
pixmapLabel->setPixmap(map);
To copy to clipboard, switch view to plain text mode
Bookmarks