Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Convert images into videos and display them in QML
Forum Updated to NodeBB v4.3 + New Features

Convert images into videos and display them in QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 715 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mihaill
    wrote on last edited by
    #1

    Hi!
    I get 10-30 images from server. If i show in android phone images in QML Image, then image flicked when updating. How convert QImages in video and show in qml?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That something that would be simpler to do server side.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mihaill
        wrote on last edited by Mihaill
        #3

        Server can retur me only images. I create class

        class ImageProvider : public QQuickImageProvider
        {
        public:
            ImageProvider() : QQuickImageProvider(QQuickImageProvider::Pixmap)
            {
            }
         
            QPixmap m_pixmap = QPixmap("/home/owner/Загрузки/image_2022-02-04_15-52-48.png");
         
            QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override
            {
                return m_pixmap;
            }
        };
        

        and set in main.cpp

        engine.addImageProvider(QLatin1String("imageProviderIRImage"),  appCore->m_imageProviderIRImage);
        

        And set source image in qml

        source: "image://imageProviderIRImage"
        

        But image no updating whin I update m_pixmap? Function requestPixmap used only once. How I can update image in QML?

        KroMignonK 1 Reply Last reply
        0
        • M Mihaill

          Server can retur me only images. I create class

          class ImageProvider : public QQuickImageProvider
          {
          public:
              ImageProvider() : QQuickImageProvider(QQuickImageProvider::Pixmap)
              {
              }
           
              QPixmap m_pixmap = QPixmap("/home/owner/Загрузки/image_2022-02-04_15-52-48.png");
           
              QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override
              {
                  return m_pixmap;
              }
          };
          

          and set in main.cpp

          engine.addImageProvider(QLatin1String("imageProviderIRImage"),  appCore->m_imageProviderIRImage);
          

          And set source image in qml

          source: "image://imageProviderIRImage"
          

          But image no updating whin I update m_pixmap? Function requestPixmap used only once. How I can update image in QML?

          KroMignonK Offline
          KroMignonK Offline
          KroMignon
          wrote on last edited by
          #4

          @Mihaill said in Convert images into videos and display them in QML:

          But image no updating whin I update m_pixmap? Function requestPixmap used only once. How I can update image in QML?

          Why should image be reloaded with this code?
          The image in loaded once by ImageProvider and in QML the link is static, so once image is loaded there is no reason to request image again.

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Mihaill
            wrote on last edited by
            #5

            It is help me. I change source when updating image.

                        imageIrImage.source = "image://imageProviderIRImage"
                        imageIrImage.source = "image://imageProviderIRImage/ir"
            
            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved