Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unable to load images properly using Qimage's load()
Forum Updated to NodeBB v4.3 + New Features

Unable to load images properly using Qimage's load()

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 455 Views
  • 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.
  • houyaweiH Offline
    houyaweiH Offline
    houyawei
    wrote on last edited by
    #1

    Use Qimage's load() to load images, print log load() and return success, but the program will get stuck in load(). If this part is removed, it will run normally

    But on my compilation host, there is no such issue on the other laptop. There is this issue on a poorly performing mini host using Qt5.9.3

    QImage img;
    img.load(pic_name);
    int WindowW = this->width()*0.9;
    int WindowH = this->height()*0.9;
    pic_label->setGeometry(0, 0, WindowW, WindowH);
    QImage scalimg = img.scaled(pic_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
    pic_label->setPixmap(QPixmap::fromImage(scalimg));
    
    Christian EhrlicherC 1 Reply Last reply
    0
    • houyaweiH houyawei

      Use Qimage's load() to load images, print log load() and return success, but the program will get stuck in load(). If this part is removed, it will run normally

      But on my compilation host, there is no such issue on the other laptop. There is this issue on a poorly performing mini host using Qt5.9.3

      QImage img;
      img.load(pic_name);
      int WindowW = this->width()*0.9;
      int WindowH = this->height()*0.9;
      pic_label->setGeometry(0, 0, WindowW, WindowH);
      QImage scalimg = img.scaled(pic_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
      pic_label->setPixmap(QPixmap::fromImage(scalimg));
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You should check the image if it is correct and can be loaded by other image viewers. A backtracce would also help here.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • houyaweiH Offline
        houyaweiH Offline
        houyawei
        wrote on last edited by
        #3

        After compiling with Qt5.15.2, the images can be loaded normally, but the processing speed is slow on the mini host and runs normally on other computers

        Christian EhrlicherC 1 Reply Last reply
        0
        • houyaweiH houyawei

          After compiling with Qt5.15.2, the images can be loaded normally, but the processing speed is slow on the mini host and runs normally on other computers

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @houyawei said in Unable to load images properly using Qimage's load():

          on the mini host

          What is this?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • houyaweiH Offline
            houyaweiH Offline
            houyawei
            wrote on last edited by
            #5

            This is a small computer, and the issue of replacing the computer host has been resolved. When the image replacement speed is too fast, the small computer cannot display it

            1 Reply Last reply
            0
            • houyaweiH houyawei has marked this topic as solved on

            • Login

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