Before you try optimizing low level rendering routines, try the following program:
#include <QtGui>
int main(int argc, char* argv[])
{
if(argc<2){
QMessageBox::information(0,
"No Arguments provided",
"Usage: bigimage <imagefile> [scaleToX scaleToY]");
return 0;
}
if(argc>3)
pix=pix.scaled(atoi(argv[2]), atoi(argv[3]));
scene.addPixmap(pix)->scale(1.1,1.1);
view.show();
return app.exec();
}
#include <QtGui>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
if(argc<2){
QMessageBox::information(0, "No Arguments provided", "Usage: bigimage <imagefile> [scaleToX scaleToY]");
return 0;
}
QPixmap pix(argv[1]);
if(argc>3)
pix=pix.scaled(atoi(argv[2]), atoi(argv[3]));
QGraphicsScene scene;
scene.addPixmap(pix)->scale(1.1,1.1);
QGraphicsView view(&scene);
view.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
I didn't have any really big images so I scaled a smaller one before adding it to the scene.
./bigimage image.tif 10000 10000
./bigimage image.tif 10000 10000
To copy to clipboard, switch view to plain text mode
On windows with Qt 4.3.0 scrolling was smooth as butter with a 10,000 x 10,000 image. Perhaps your problem lies elsewhere?
Bookmarks