Results 1 to 4 of 4

Thread: editable rectangles

  1. #1
    Join Date
    Feb 2008
    Location
    Porbandar
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Exclamation editable rectangles

    Dear friends,
    Good Morning...
    I am using LINUX with Qt 4.
    DETAILS: I have black & white scanned copy of text document. Further I have filtered and even binarized that image ( jpg or tiff) Now I am to draw editable rectangle on words. I have been able to draw RED rectangle using SETPIXEL( ) on an IMAGE as shown in attachment 1. For that purpose i tried a lot with function like DRAWRECT but I could not.
    So I have regenerated the whole image keeping black pixel as black & white as white in new image AND then draw RED rectangle (given coordinate) with two FOR loops using setpixel().(here in attachment i have shown non filterd image to feel background image)


    PROBLEM: How to edit that rectangle which has been drawn on image ? I mean to say how will I be able to change the dimensions of rectangle using mouse event? It is some thing like we do adjust the hor. & vertical lines in table in MS WORD with mouse.
    In short how to change rectangle in attch1 to look like in attch2?

    Thanx
    Ranjit Parmar
    INDIA
    Attached Images Attached Images
    • File Type: jpg 1.jpg (3.3 KB, 11 views)
    • File Type: jpg 2.jpg (3.5 KB, 9 views)

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: editable rectangles

    As long as the rectangle should remain editable you might not want to add that rectangle to the image itself but just render it over the image on screen.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    parmar ranjit (21st February 2008)

  4. #3
    Join Date
    Oct 2007
    Posts
    7
    Thanked 1 Time in 1 Post

    Default Re: editable rectangles

    I would load the base image in a QGraphicsScene, then I can create rectangles without changing the underlying image. Then you display the scene using a QGraphicsView widget. Selecting and drag-and-drop are built into these two classes.

  5. The following user says thank you to yosefm for this useful post:

    parmar ranjit (21st February 2008)

  6. #4
    Join Date
    Feb 2008
    Location
    Porbandar
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Re: editable rectangles

    Thnx for reply,
    ya
    You are right. Even when I have been able to draw perfectly rectangles on image using setPixel( ) at specifed coordinates of image, but yet it will not be possible to DRAG or EDIT those rectangles because they are the part of the image at pixel level.

    Since I am new to Qt, will you please elaborate in little more detail using some simple code :
    How to form editable rectangle at given coordinates on image?
    I think then only it will be possible to DRAG it using MOUSE.

    Waiting eagerly 4 reply
    Ranjit Parmar:

Similar Threads

  1. QTreeWidget editable
    By hgedek in forum Newbie
    Replies: 2
    Last Post: 5th February 2008, 08:50
  2. QTreeView rows editable
    By Pesho in forum Qt Programming
    Replies: 5
    Last Post: 13th September 2007, 13:19
  3. QTreeWidget - Making a Column editable.
    By Preeteesh in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2007, 12:02
  4. Editable cells in QTableView
    By TheRonin in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2006, 17:39
  5. Editable QListView Column ??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 3rd May 2006, 18:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.