Viewing and zooming images
Hello,
I would like to display an image and have the possibility to zoom in/out the image. I tried http://qt-project.org/doc/qt-5.0/qtw...ageviewer.html but it consumes huge amounts of memory - it is practically impossible to zoom in more than 8x or so. Also, the zooming becomes somewhat slow at larger ratios.
Please, is there a less memory-intensive (and faster) way to show and zoom images? Also, I think the above example uses bicubic interpolation - is it possible to use different method, for example nearest neighbor?
Re: Viewing and zooming images
Everything is possible if you're willing to implement it.
Re: Viewing and zooming images
Use OpenGL to display image
Re: Viewing and zooming images
Quote:
Originally Posted by
Jonny174
Use OpenGL to display image
Thanks! But I'm not exactly fluent with OpenGL (that is, not at all fluent) - do you perhaps know of any other way besides OpenGL?
Quote:
Originally Posted by
wysota
Everything is possible if you're willing to implement it.
Sure. Do you perhaps have an advice on how to work around the considerable memory requirements of QLabel?
Certainly it is possible to implement nearest neighbor, I was just hoping there is a setting in Qt for that..?
Re: Viewing and zooming images
Quote:
Originally Posted by
ecir.hana
Do you perhaps have an advice on how to work around the considerable memory requirements of QLabel?
If you want to make an image 4x bigger, it will consume 4x as much memory, there is no way to "work around" it. If you want to consume less memory then divide the image into tiles, zoom each tile separately one at a time, do whatever you want with a tile, free the memory and proceed to the next tile.
Quote:
Certainly it is possible to implement nearest neighbor, I was just hoping there is a setting in Qt for that..?
Qt::FastTransformation
Re: Viewing and zooming images
Quote:
Originally Posted by
wysota
If you want to make an image 4x bigger, it will consume 4x as much memory, there is no way to "work around" it.
I was thinking that maybe QPainter::scale and QPainter::drawPixmap would somehow crop the zoomed image and automatically scale only the needed portion..?
Thanks anyway!