[Qt-interest] How to zoom a particular selected region in QCanvas in Qt-3.3.6
Brad Howes
howes at ll.mit.edu
Mon Oct 5 16:20:37 CEST 2009
On Oct 5, 2009, at 9:41 AM, Rehan wrote:
> I am using Qt-3.3.6. My requirement is to select a particular
> portion of the canvas and zoom in/out the same.
> Could someone please guide me, Is there any QT direct method or I
> have to customize?
Just use QMatrix (I think it is called that in Qt3). You know the
dimensions of the area the user wanted, and you know your current view
port, so just create an appropriate scaling and translation so that
the new points become the corners of the view. If you want to preserve
aspect ratio, then you will have to use min or max on the x and y
scale values.
Brad
--
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091005/bf69f41f/attachment.html
More information about the Qt-interest-old
mailing list