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. Manipulating Images
Forum Updated to NodeBB v4.3 + New Features

Manipulating Images

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.7k 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.
  • S Offline
    S Offline
    Sorin
    wrote on last edited by
    #1

    How can I modify an image at runtime?. Lets say that I want to paint a part of the image with a different color. Since I'm new on Qt a small basic example would be appreciated :) . Thanks!

    There are only 10 types of people in the world: Those who understand binary, and those who don't

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tony
      wrote on last edited by
      #2

      Hi,

      check the documentation regarding the class "QImage":http://doc.qt.nokia.com/4.7/qimage.html

      Tony.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        danilocesar
        wrote on last edited by
        #3

        Just complementing what Antonio said:

        You can use "QPainter APIs":http://doc.trolltech.com/4.6-snapshot/qpainter.html to paint whatever you want to in any QPaintDevice (QImage, QPicture, QPixmap and QPrinter are examples of paint devices).

        Just open your QPainter on an image:

        @QPainter p(myImage);@

        and than paint something on it

        "p->drawElipse":http://doc.trolltech.com/4.6-snapshot/qpainter.html#drawEllipse
        "p->drawImage":http://doc.trolltech.com/4.6-snapshot/qpainter.html#drawImage-8
        etc...

        <a href="http://www.danilocesar.com">Danilo Cesar Lemes de Paula</a>
        Software Engineer

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          you can do a whole bunch of stuff on images as others have already replied. you can apply effects, you can do custom painting on top of it, or you can run through individual pixels in the image and modify them how ever you want, see one example I just created in this "wiki page":http://developer.qt.nokia.com/wiki/Manipulate_image_and_apply_RGB_mask

          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