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 scale image in paintevent

How to scale image in paintevent

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 698 Views 3 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.
  • Pradeep KumarP Offline
    Pradeep KumarP Offline
    Pradeep Kumar
    wrote on last edited by
    #1

    Hi,

    Can anyone provide , how to scale the image in paintevent,
    i am using QImage and then painting on QWidget.
    using paintevent.?

    Thanks,

    Pradeep Kumar
    Qt,QML Developer

    kshegunovK 1 Reply Last reply
    0
    • Pradeep KumarP Pradeep Kumar

      Hi,

      Can anyone provide , how to scale the image in paintevent,
      i am using QImage and then painting on QWidget.
      using paintevent.?

      Thanks,

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      http://doc.qt.io/qt-5/qimage.html#scaled

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      2
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        and as a note
        it returns the scaled image as copy. its NOT affecting the original.
        so u must do
        QImage scaled=orgpic.scaled(xx)

        1 Reply Last reply
        2

        • Login

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