Results 1 to 20 of 20

Thread: QPixmap pixel by pixel ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: QPixmap pixel by pixel ?

    You can use QPixmap::fromImage( it is static in QPixmap) to obtain a QPixmap. But this approach is usually expensive.

    It is better to subclass QLabel and override it's paint event and draw the QImage in there. via QPainter::drawImage().

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

    tommy (3rd December 2007)

  3. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QPixmap pixel by pixel ?

    Quote Originally Posted by marcel View Post
    It is better to subclass QLabel and override it's paint event and draw the QImage in there. via QPainter::drawImage().
    The painful fact is that as fat as I remember the image is going to be converted to a pixmap before being drawn anyway (at least on X11).

Similar Threads

  1. QPixmap and HBITMAP
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 16:24

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.