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. [Solved] How to reflect an image at a label?

[Solved] How to reflect an image at a label?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 5.6k 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.
  • L Offline
    L Offline
    Leon
    wrote on 10 Jul 2011, 15:56 last edited by
    #1

    I have 2 labels with images.. The images is the same thing but the other is a reflection of it.. ( So it is the original image and the other one edited with gimp, so 2 images )..
    Is there any way i can reflect the original right away at the label ( so i can delete the reflected-edited image ).. Check out this screenshot to understand what i mean..

    !http://img838.imageshack.us/img838/217/screenshotpreferencesk.png(Screenshot)!

    Thanks :)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on 10 Jul 2011, 16:06 last edited by
      #2

      QImage::mirrored?

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Leon
        wrote on 10 Jul 2011, 16:24 last edited by
        #3

        [quote author="peppe" date="1310313975"]QImage::mirrored?[/quote]

        @QString filename = ":/icons/Pictures/speaker.png";
        QImage image(filename);
        image.mirrored();
        ui->label_3->setPixmap(QPixmap::fromImage(image));@

        I know the image.mirrored part is wrong.. Can you tell what should i have in place of that line?

        1 Reply Last reply
        0
        • I Offline
          I Offline
          itwiz
          wrote on 10 Jul 2011, 16:49 last edited by
          #4

          It should be
          @
          QString filename = ":/icons/Pictures/speaker.png";
          QImage image(filename);
          //Original image is not changed,so create a copy to store mirror image
          QImage mirrorImage = image.mirrored(true,false);
          ui->label_3->setPixmap(QPixmap::fromImage(mirrorImage));
          @

          Edit: please use @ tags around code sections; Andre

          1 Reply Last reply
          0
          • L Offline
            L Offline
            Leon
            wrote on 10 Jul 2011, 16:53 last edited by
            #5

            Cool thanks, it works!

            1 Reply Last reply
            0

            4/5

            10 Jul 2011, 16:49

            • Login

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