Results 1 to 4 of 4

Thread: Fastest PaintDevice?

  1. #1
    Join Date
    Sep 2007
    Location
    Berlin, Germany
    Posts
    17
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Fastest PaintDevice?

    I am wondering what the best (fastest) paint device would be for my application. I am doing the following: I get a couple of images via http requests. Those I store as QPixmaps. Then I draw these pixmaps into a larger pixmap to get a "composed" image. To display this image I call painter.drawPixmap(composedPixmap) within the paintEvent of the Widget. Is this the fastest way to realize this? I don't exacly know if a QImage could be faster.

    Instead of using drawPixmap in the paintEvent of the widget bitblt() would surely be faster, but before I can use this, I have to convert the QPixmap into a QImage, and I don't think that's worth it.

    Then... another question how do I performant move this composed image on the display? Do I give the "scrolling value" when calling drawPixmap()? I realised, this is faster than using painter.translate(). What about the performance of painter.setViewport()? (I would try this later myself, but I think if I'm already asking so many questions... )

    If anybody have links for performant graphic programming on a Qtopia device I would be very happy to get them.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Fastest PaintDevice?

    Can't you keep only that composed pixmap?

  3. #3
    Join Date
    Sep 2007
    Location
    Berlin, Germany
    Posts
    17
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Fastest PaintDevice?

    Yes, that composed pixmap also acts as my offscreen image. I forgot to tell, that I often have to redraw this composed pixmap depending on the user input.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Fastest PaintDevice?

    On X Windows QPixmap is kept on the server, so drawPixmap() is the fastest way to display it. On M$ windows, QPixmap is practically the same thing as QImage (from OS's point of view). I'm not sure how exactly it's implemented in case of Qtopia, but QPixmap is designed for displaying, while QImage --- for per-pixel modifications.

    In case of performance problems, make sure you draw and display only what you have to --- ask QPaintEvent what part of the widget needs to be updated. View transformations might cost you a lot, because the image has to be rescaled each time you draw it, although it might be accelerated by hardware.

Similar Threads

  1. What is the fastest way to draw a circle ?
    By Vladimir in forum Qt Programming
    Replies: 18
    Last Post: 6th September 2007, 18:26
  2. Fastest way to clear a QList
    By steg90 in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 10:26

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.