Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-52037

QQuickWindow::grabWindows() can't get image.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.5.1, 5.6.0
    • QPA
    • None
    • Android

    Description

      android device
      I can get a normal image by call QQuickWindow::grabWindows() at most devices,but only at a few device I gotted a black image.
      why? i think android device cause this problem, but the greater reason is Qt.

      a demo in attachment. you can check it.

      void ALGrabber::grabPicture(QQuickWindow *w)
      {
      // emit sigSharePicture(w->grabWindow());
      QImage image = w->grabWindow();
      QString savePath = "/sdcard/temppp.png";
      QDir dir = QFileInfo(savePath).absoluteDir();
      if(!dir.exists())

      { dir.mkdir(QFileInfo(savePath).absolutePath()); }

      image.save(savePath);
      }

      Attachments

        Issue Links

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              lanxiaziyi lanxiaziyi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: