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. Resize image with mouse QTextEdit

Resize image with mouse QTextEdit

Scheduled Pinned Locked Moved Solved General and Desktop
imageresizeqtexteditmouse
10 Posts 5 Posters 5.1k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    Hello.

    i am working on a texteditor and it works fine actually. But i have a problem. I want to resize images for QTextEdit inside a dialog. And this dialog should show the image (which shall be resized) and some lines and rectangles like in Word 2013, when you click on the image, the resize corners comes up. Than you drag and drop with the mouse the size you want to give the image.
    And now my question: Is it possible in an not too difficult way ? Some tips or and little exmple would help me a lot!

    Thanks to all in advance. It would be cool, if the image shoudn't be saved on the disk and then inserted again. So resize it and the size of the image is changed after accepting the dialog with OK for example.

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      There's an interesting thread on stack overflow for that question.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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

        Thanks for your answer. That's the code I am using actually for resizing images. But I want to resize them with the mouse...

        1 Reply Last reply
        0
        • P Offline
          P Offline
          patrik08
          wrote on last edited by
          #4

          Hi .... as example from crop image , resize , apply filter on image is 9 years old code but its run...
          https://github.com/pehohlva/xhtml_edit_qedit_base/blob/master/src/interface.cpp
          I have found a matrix for make this...

          0_1503731327758_xmledit.png

          to find:
          https://github.com/pehohlva/xhtml_edit_qedit_base
          you can make a refactoring from code to load external image to...

          1 Reply Last reply
          3
          • P Offline
            P Offline
            patrik08
            wrote on last edited by
            #5

            I have adapted this code from qt4.8 to qt5.9.1 one mac el capitan but is not simple found all new qt5.9 object wath is chance ... but i say the installer is in https://sourceforge.net/projects/wysiwyg-edit/ file...
            all week is 20 download from 2007...

            1 Reply Last reply
            2
            • P Offline
              P Offline
              patrik08
              wrote on last edited by
              #6

              I have made a sample from a main.cpp & one header... 2 file
              Only color filter not run clean , crop , resize , rotate is ok...

              wget https://raw.githubusercontent.com/pehohlva/QOASIS/master/test/edit_q/main.cpp
              wget https://raw.githubusercontent.com/pehohlva/QOASIS/master/test/edit_q/interface.h
              wget https://raw.githubusercontent.com/pehohlva/QOASIS/master/test/edit_q/edit_q.pro
              
              1 Reply Last reply
              1
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                Thanks.
                That's what I was searching for...

                But I have problems with Implementation. I don't know where and how to do that...

                Maybe someone can help me with this or can do that and explain what he did.

                Thanks in advance

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  salwa
                  wrote on last edited by
                  #8

                  @HenrikSt
                  Hello, did you resolve the problem?

                  mrjjM 1 Reply Last reply
                  0
                  • S salwa

                    @HenrikSt
                    Hello, did you resolve the problem?

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @salwa
                    Hi
                    You do realize its via a dialog? no in place in the textEdit directly.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      salwa
                      wrote on last edited by
                      #10

                      @mrjj
                      I don't want to resize it via a dialog. I need to do that with the mouse (manually)

                      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