Zoom the paintevent data using qrubberband
hey i made a gui in which i draw manything using paintevent .now i want to put zoom functionality in this .so, i want that selcted area should be zoom for this i am using qrubberband but i do not know how to zoom selected area .please give me some suggession or some demo code. thanks in advance.
Re: Zoom the paintevent data using qrubberband
You know the top left coordinate (in pixels) of the zoom rect, and you can compute the width and height scale factors compared to the full view (x-scale = fullwidth / zoomwidth, y-scale = fullheight / zoomheight). Use QPainter::translate() to move the zoom rect, followed by QPainter::scale() to magnify the contents to fit the whole view.