Results 1 to 6 of 6

Thread: Resize Image

  1. #1
    Join Date
    May 2009
    Posts
    9
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Resize Image

    Hi,

    I loaded image using QPixmap. Now i want to resize that image, for resizing it i used QPixmap::scaled() method. but it does not do anything.

    Then how can i resize my image???

    I am using Qt for S60 4.5.0-garden release.

    Thanks,

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resize Image

    QPixmap::scaled() returns a copy of the pixmap which is resized to the new dimensions. Are you assuming that the existing image itself is resized?

  3. The following user says thank you to munna for this useful post:

    kamlesh.sangani (14th May 2009)

  4. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Resize Image

    QPixmap::scaled returns scalde pixmap, so you should write something like this
    Qt Code:
    1. ...
    2. QPixmap scaledPixmap = myPixmap(QSize(100, 100));
    3. label->setPixamp(scaledPixmap);
    4. ...
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #4
    Join Date
    May 2009
    Posts
    9
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Resize Image

    Quote Originally Posted by munna View Post
    QPixmap::scaled() returns a copy of the pixmap which is resized to the new dimensions. Are you assuming that the existing image itself is resized?
    Indeed that was the problem.

    Thanks a lot!!!!

  6. #5
    Join Date
    May 2009
    Posts
    9
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Resize Image

    Quote Originally Posted by spirit View Post
    QPixmap::scaled returns scalde pixmap, so you should write something like this
    Qt Code:
    1. ...
    2. QPixmap scaledPixmap = myPixmap(QSize(100, 100));
    3. label->setPixamp(scaledPixmap);
    4. ...
    To copy to clipboard, switch view to plain text mode 
    Thanks for reply.

    I already tried something like

    Qt Code:
    1. QPixmap scaledPixmap = myPixmap(QSize(100, 100));
    2. scaledPixmap.Load();
    To copy to clipboard, switch view to plain text mode 

    But it did not helped me. BTW now issue is resolved.

  7. #6

    Default Re: Resize Image

    if you want to resize image than i will you suggest you to visit the below link
    http://www.raiseitsolutions.com/foru...ic.php?f=4&t=3
    please visit the link, here you can know about how to resize image.
    thank you very much.

Similar Threads

  1. Image Commander v.1.2
    By piotrek in forum Qt-based Software
    Replies: 0
    Last Post: 20th April 2009, 11:59
  2. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 16:36
  3. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 03:10
  4. Explanation to Image Formats
    By sincnarf in forum Qt Programming
    Replies: 13
    Last Post: 6th July 2007, 18:02
  5. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 17:36

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.