Results 1 to 13 of 13

Thread: Any fast way(<10ms) to display 640*480 QImage on QGraphicsScene?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Any fast way(<10ms) to display 640*480 QImage on QGraphicsScene?

    I did this with Qt3, but Qt4 is so different that its not aplicable any more.
    The general rule is that you should try to minimize Qt's conversion functions as much as possible.
    I would try something along the lines of:
    - load the buffer to a QImage
    - Set QBrush as texture with the QImage
    - use QPainter::fillRect() with the texture brush.

    I didn't try this, but I'd expect it to be fast enough.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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

    KiwiRider (10th May 2007)

  3. #2
    Join Date
    May 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Question Re: Any fast way(<10ms) to display 640*480 QImage on QGraphicsScene?

    Quote Originally Posted by high_flyer View Post
    I did this with Qt3, but Qt4 is so different that its not aplicable any more.
    The general rule is that you should try to minimize Qt's conversion functions as much as possible.
    I would try something along the lines of:
    - load the buffer to a QImage
    - Set QBrush as texture with the QImage
    - use QPainter::fillRect() with the texture brush.

    I didn't try this, but I'd expect it to be fast enough.
    Hi, high_flyer,

    Thank you for your reply

    I tried this way,

    Qt Code:
    1. QPainter *painter;
    2. painter = new QPainter();
    3. painter->fillRect(QRect(0,0,width,height),QBrush::QBrush(capture_frame));
    To copy to clipboard, switch view to plain text mode 

    where capture_frame is QImage object,

    there was no error in compile but no result neither.

    Am I doing it right way?
    Last edited by jacek; 10th May 2007 at 02:06. Reason: changed [qtclass] to [code]

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.