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. How to resize my .gif file to full screen in any monitor? C++

How to resize my .gif file to full screen in any monitor? C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 670 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.
  • R Offline
    R Offline
    Raikoho
    wrote on last edited by Raikoho
    #1

    I have created an app that show my gif, but any gifs shows with their own size and i do not know how to resize they to full screen. I use only QLabel, becouse it doesn't show any frame and icons. I need only gif as result. Here my code:

    #include <QtGui>
    #include <QMainwindow>
    #include <QString>
    #include <QPixmap>
    #include <QtWidgets>
    #include <QLabel>
    #include <QApplication>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QLabel* label = new QLabel();
        label->setWindowFlags(Qt::FramelessWindowHint);
        label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
            label->setScaledContents(true);
            label->setMargin(0);
        label->setMask((new QPixmap("F:\\ADDOBE ANIMATE\\proj\\ulq.gif"))->mask());
     QMovie *movie = new QMovie("F:\\ADDOBE ANIMATE\\proj\\ulq.gif");
     label->setMovie(movie);
     movie->start();
        label->show();
     return a.exec();
    
    
    }
    
    

    Can u help me how to resize result to full screen? And is this code a good way to show animations? Sorry for mistakes in English

    Pl45m4P 1 Reply Last reply
    0
    • R Raikoho

      I have created an app that show my gif, but any gifs shows with their own size and i do not know how to resize they to full screen. I use only QLabel, becouse it doesn't show any frame and icons. I need only gif as result. Here my code:

      #include <QtGui>
      #include <QMainwindow>
      #include <QString>
      #include <QPixmap>
      #include <QtWidgets>
      #include <QLabel>
      #include <QApplication>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QLabel* label = new QLabel();
          label->setWindowFlags(Qt::FramelessWindowHint);
          label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
              label->setScaledContents(true);
              label->setMargin(0);
          label->setMask((new QPixmap("F:\\ADDOBE ANIMATE\\proj\\ulq.gif"))->mask());
       QMovie *movie = new QMovie("F:\\ADDOBE ANIMATE\\proj\\ulq.gif");
       label->setMovie(movie);
       movie->start();
          label->show();
       return a.exec();
      
      
      }
      
      

      Can u help me how to resize result to full screen? And is this code a good way to show animations? Sorry for mistakes in English

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Raikoho said in How to resize my .gif file to full screen in any monitor? C++:

      I use only QLabel, becouse it doesn't show any frame and icons

      You still can use a frameless QWidget / QWindow. (setWindowFlags(Qt::FramelessWindowHint)), because then you could do something like:

      window.showFullScreen();
      

      (showFullScreen() does not work on QLabel)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0

      • Login

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