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 Create an Interphase to load, edit and save image?

How to Create an Interphase to load, edit and save image?

Scheduled Pinned Locked Moved Solved General and Desktop
widgetimage displayimage processinmouse controlmarkings
4 Posts 2 Posters 2.2k 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.
  • B Offline
    B Offline
    beginMyCoding
    wrote on last edited by
    #1

    Hello Coders and developers

    I want to make a graphical interface containing two windows two load and display images from desktop. In the first window the loaded image should be displayed and i want to perform some image operations like zoom in/out, use mouse to mark some points on image and draw lines on the image. The result of the image should be displayed in second window.
    With help of QT widget application i can make windows to load images and display but i dont know how to use markings on the image and draw lines.
    I am relly a beginner in C++ and QT is also new to me. Previously i worked on Matlab bt the coding is different in this.
    Can anyone please say me how to do these steps. Any tutorial is all much helpful.
    Thank you all

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi, and welcome to the Qt forum! The easiest way to draw lines etc on a widget is by using the QPainter API. Have a look at the Analog Clock Example.

      B 1 Reply Last reply
      1
      • ? A Former User

        Hi, and welcome to the Qt forum! The easiest way to draw lines etc on a widget is by using the QPainter API. Have a look at the Analog Clock Example.

        B Offline
        B Offline
        beginMyCoding
        wrote on last edited by
        #3

        @Wieland Thanks for your answer wieland, I have seen the analog clock example but it did not help me much. Scribbling example is a bit relevant for me as i want to paint on the image after execution and not during writing the code.

        I do have one more question, how can we get the position of points on the image when we mark some points using pain?. To say it in simple, in the scribbling example if i mark two points using paint then the program should store the positions of that points. I could not find any functions like getPositions in QT or i hope i am not using relevant libraries.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          I'm not completely sure what you mean. If you want to get the current position of the mouse cursor in coordinates relative the widget that displays your image then you can do this:

          QPoint currentPosition = widget->mapFromGlobal( QCursor::pos() );
          
          1 Reply Last reply
          1

          • Login

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