Overall Research on Image ROI display/scaling/dragging

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.