Results 1 to 15 of 15

Thread: Question about QImages

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Question about QImages

    Sorry but in the case of the scroll bars, the changes on the edited image in which moment are "updated" at the original image?
    Last edited by SkripT; 20th January 2006 at 18:07.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Question about QImages

    if you use the scroll bar option you dont need two images, only one, the one that you see, in the size it is at the moment, so when you edit it you are editing the image it self, no need to remember anything aside the original size.

  3. #3
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Question about QImages

    Well so here's the question that i make at the beginning of the thread: if you work only with the edited image and you apply recursive zooming to the image, it will lose quality, won't it?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Question about QImages

    yes it will as I said, you can't put the same amount of information in less "space".
    When you scale down you loos information.

    I thought your question was about the error you get from calculating your self the scaling, and my point was that you dont need to do it your self, but can let Qt do it for you.

  5. #5
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Question about QImages

    Hi, finally I have solved the problem. It's a little complicated to explain; in a little words the problem was that I was scaling at any "ratio" while all the other editors scale in order of 1/2, 1/3, 1/4, 1/5, .. Doing it in this way solves the problem of loss of precition. Thanks high_flyer

  6. #6
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Question about QImages

    If you keep the original image, and paint it scaled when zooming, keep track of the viewing transformation and use the inverse transformation to paint _in the original image_, loss of information is avoided, regardless of the zoom factor. The zoom factor will only determine the quality/amount of information of the displayed image, not of the original one.

    If the size of the images is not too large, and only modest zoomlevels up to something like 200% are needed, using QCanvasView (Qt3) might be a good idea. (No idea about Qt4.)

    Pieter

  7. #7
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Question about QImages

    Hi Peter, the problem is that the mouse coordinates are from the scaled image, so they has to be translated to the original image with no less of precition. That's why not every scale could be correct.

Similar Threads

  1. Useless but curious compiler warning question
    By Raccoon29 in forum General Programming
    Replies: 4
    Last Post: 30th July 2008, 20:46
  2. SQL Question
    By ^NyAw^ in forum Qt Programming
    Replies: 5
    Last Post: 8th April 2008, 19:36
  3. Access to QSqlTableModel::isDirty Question.
    By patrik08 in forum Qt Programming
    Replies: 3
    Last Post: 12th April 2007, 17:49
  4. Replies: 1
    Last Post: 15th March 2007, 20:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.