Results 1 to 5 of 5

Thread: Error : qt_pixmapFromWinHBITMAP, failed create image of 1280x720

  1. #1
    Join Date
    Mar 2016
    Posts
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Error : qt_pixmapFromWinHBITMAP, failed create image of 1280x720

    I am working on multi threading : one thread is capturing the QImage of QWebView as QWebFrame :

    Qt Code:
    1. void XXXXX::SaveImage(QWebFrame *frame)
    2. {
    3. QImage image(frame->contentsSize(), QImage::Format_ARGB32_Premultiplied);
    4. image.fill(Qt::transparent);
    5. QPainter painter(&image);
    6. painter.setRenderHint(QPainter::Antialiasing, true);
    7. painter.setRenderHint(QPainter::TextAntialiasing, true);
    8. painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
    9. frame->documentElement().render(&painter);
    10. painter.end();
    11.  
    12. captureImage.push_back(image);
    13. }
    To copy to clipboard, switch view to plain text mode 
    and I use the other thread to popup the Qlist data.

    But after 2-3 minutes, my application crashes with the below errors.

    qt_pixmapFromWinHBITMAP, failed create image of 1280x720

    QWaitCondition: Destroyed while threads are still waiting terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc LEAK: 6 RenderObject LEAK: 1 Page LEAK: 1 Frame LEAK: 2 CachedResource LEAK: 28 WebCoreNode
    Anyone have an idea why this error is coming?
    Last edited by anda_skoa; 15th April 2016 at 10:16. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Error : qt_pixmapFromWinHBITMAP, failed create image of 1280x720

    Looks to me like your app crashed because it ran out of memory after storing too many big images. Each of your images is at least 3.5 MB. If you are saving one every second, after 2 - 3 minutes, that's 400 - 600 MB, and I think you are probably storing them faster than that, right?

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Error : qt_pixmapFromWinHBITMAP, failed create image of 1280x720

    Quote Originally Posted by tomer.vinay86 View Post
    and I use the other thread to popup the Qlist data.
    If you are accessing captureImage from both threads, you need to protect against concurrent access.

    Cheers,
    _

  4. #4
    Join Date
    Mar 2016
    Posts
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Error : qt_pixmapFromWinHBITMAP, failed create image of 1280x720

    Thanks for reply. issue is resolved

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Error : qt_pixmapFromWinHBITMAP, failed create image of 1280x720

    Well, certainly don't tell anyone here how you resolved it. Someone might learn something useful to them.

Similar Threads

  1. Send Image over TCP failed ??
    By ganapathi in forum Qt Programming
    Replies: 4
    Last Post: 2nd December 2015, 11:26
  2. Replies: 0
    Last Post: 4th May 2014, 10:41
  3. Replies: 0
    Last Post: 15th October 2013, 09:32
  4. QML Image: Failed to get image from provider
    By mismael85 in forum Qt Quick
    Replies: 1
    Last Post: 13th December 2012, 15:37
  5. Failed to create fragment programs.
    By jeeman in forum Qt Programming
    Replies: 5
    Last Post: 19th June 2007, 00:03

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.