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 solve the png files on different screen pixs?
Forum Updated to NodeBB v4.3 + New Features

How to solve the png files on different screen pixs?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 325 Views 2 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.
  • nicker playerN Offline
    nicker playerN Offline
    nicker player
    wrote on last edited by
    #1

    when i run the program with the label icon on the high dpi screen computer.the background image of the png files looks like not smoothly.how to solve the outlook of the bg images on different level of the screen dpis?
    9d7181ae-522c-4e93-aa0d-f4091f3b977c-image.png

    Pl45m4P 1 Reply Last reply
    0
    • nicker playerN nicker player

      when i run the program with the label icon on the high dpi screen computer.the background image of the png files looks like not smoothly.how to solve the outlook of the bg images on different level of the screen dpis?
      9d7181ae-522c-4e93-aa0d-f4091f3b977c-image.png

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

      @nicker-player

      Try an SVG icon.


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

      ~E. W. Dijkstra

      Christian EhrlicherC nicker playerN 2 Replies Last reply
      0
      • Pl45m4P Pl45m4

        @nicker-player

        Try an SVG icon.

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

        @Pl45m4 Since it only takes a QPixmap the (currently) only way is to provide a pixmap with the same resolution but a higher devicePixelRatio. E.g. scale the svg to 2x the desired size, convert it to a pixmap, set the pixmaps device pixel ratio to 2.

        Maybe I can get this patch in soon: https://codereview.qt-project.org/c/qt/qtbase/+/569056

        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
        1
        • Pl45m4P Pl45m4

          @nicker-player

          Try an SVG icon.

          nicker playerN Offline
          nicker playerN Offline
          nicker player
          wrote on last edited by
          #4

          @Pl45m4
          Ive tried the svg file.the icon could be normal on diffrent dpi platforms.but another problem came out,that I just dont know the way to make the other svg image when pressing or hovered the pushbutton.

          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