Results 1 to 7 of 7

Thread: How to paint a selection rectangle on a pixmap?

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: How to paint a selection rectangle on a pixmap?

    Ok, I understand. But this solution will cause a lot of flickering when I move the scroll bars. It' wouldn't be more simple just inserting the image as the background of the QScrollArea with setPalette?

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: How to paint a selection rectangle on a pixmap?

    It will not cause a lot of flickering if done right, e.g. using double buffering
    It's nice to be important but it's more important to be nice.

  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: How to paint a selection rectangle on a pixmap?

    Yes you are right. But I will be very grateful if you can give me some more details of how to do this double buffering (I haven't much practice working with images...)

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: How to paint a selection rectangle on a pixmap?

    If you are using Qt4, you're fine: Just draw the pixmap using QPainter::drawPixmap. If you use Qt3, first draw in a QPixmap and then bitBlt the QPixmap to the screen.

    I think Johan's pixmap view provides source that could be helpfull:

    http://www.digitalfanatics.org/e8joh...ies/index.html
    It's nice to be important but it's more important to be nice.

  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: How to paint a selection rectangle on a pixmap?

    Ok thanks again

Similar Threads

  1. QPainter::begin: Cannot paint on a null pixmap
    By sabeesh in forum Qt Programming
    Replies: 5
    Last Post: 27th July 2010, 18:03
  2. How to remove the dotted rectangle of selection
    By jiveaxe in forum Qt Programming
    Replies: 5
    Last Post: 18th April 2010, 22:00
  3. QTableView, no selection rectangle
    By alisami in forum Qt Programming
    Replies: 13
    Last Post: 25th December 2008, 19:50
  4. Paint XP radio button to pixmap
    By Ben.Hines in forum Qt Programming
    Replies: 2
    Last Post: 26th April 2006, 21:15

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.