Results 1 to 3 of 3

Thread: scaling problem in qpixmap

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: scaling problem in qpixmap

    QPixmap::scaled() returns a copy of the pixmap that is scaled. It does not alter the original pixmap. You are currently discarding the returned pixmap. Try:
    Qt Code:
    1. QPixmap pixmap("C:/somepixmap.png");
    2. pixmap = pixmap.scaled(1000, 600);
    3. j->addPixmap(pixmap);
    To copy to clipboard, switch view to plain text mode 

    BTW: there's probably no reason to allocate your QPixmap on the heap.

  2. The following user says thank you to ChrisW67 for this useful post:

    erfan (22nd June 2012)

  3. #2
    Join Date
    Jun 2012
    Posts
    12
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: scaling problem in qpixmap

    so thanks chris;

Similar Threads

  1. Qwt Log Scaling Problem
    By BettaUseYoNikes in forum Qwt
    Replies: 1
    Last Post: 24th November 2011, 07:20
  2. Translation problem while scaling an object
    By qlands in forum Qt Programming
    Replies: 0
    Last Post: 4th October 2010, 12:04
  3. Pixmap scaling problem
    By tommy in forum Qt Programming
    Replies: 1
    Last Post: 14th May 2009, 17:00
  4. Scaling Painter without scaling the coordinate sytem
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 7th January 2008, 21:30
  5. QPixmap scaling question
    By eric in forum Qt Programming
    Replies: 6
    Last Post: 20th November 2007, 17:40

Tags for this Thread

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.