Tool: Visual studio2008, qt4.8 vs plug-in, gdal Library
Function: First zoom out a large image and select a rectangular area (ROI) from the scaled down image. The actual image can be scaled and dragged with the mouse, like Google map.
The qgraphicsview framework is used for thumbnails and big image display areas. Because the qgraphicsview framework has rich functions, it is suitable for graphic image display operations.
The procedure is as follows:
1. Image Scaling: Use the Image Data Reading interface of gdal library to read the sampled data according to the desired magnification. The data is displayed in the thumbnail area.
2. select the ROI to obtain the coordinates of the mouse point in the image (Click and release), and then obtain the size of the area selected by the mouse in the original image based on the magnification, read and display Original Image Data
3. image Scaling: based on the original image data of the region, a Gaussian pyramid is constructed based on the source image data. The data on each layer is saved, and the data layer to be displayed is found based on scaling, display the image to be displayed
4. Drag the image to get the length of the mouse movement. You can drag a slider based on its length. The qgraphicsview class inherits from the qw.actscrollarea class, so there is a qscrollbar object.
The above are the overall ideas and methods. For specific implementation, refer to otherArticleThe index is as follows:
Image ROI display: Http://www.cnblogs.com/Romi/archive/2012/11/21/2781753.html
Image Scaling: Http://www.cnblogs.com/Romi/archive/2012/11/22/2782151.html
Drag an image: Http://www.cnblogs.com/Romi/archive/2012/11/22/2782733.html