Display rectangle on Image
Hi,
I am using Linux, Qt4.3
Dear freinds,
I am to draw editable rectangle at given coordinates of image.
or say
How to superimpose editable rectangle at given coordinates of image
Presently I am able to draw the rubbeband rectangle with mouse event directly on image which is on QLABEL. But editing rectangle is my next phase. I am finding problem in first phase with second phase ready....!
Problem: How to draw rectangle at specified coordinate of image?
Early answer awaited....
Advance thanx
Re: Display rectangle on Image
Have you seen QRubberBand?
Re: Display rectangle on Image
yes jacek,
I had seen QRubberband and have been able to draw the rubber band rectangles directly on image .
But my question is : Initially I want to draw certain rectangles on image( I mean on QLabel) having their coordinates specified in our program code itself. And then I should be able to rubber band it or modify it by mouse .
So editing is next phase, firstly I want to draw rectangles on image via coordinats in program code in an array .
I hope I have been able to make you understand the problem
And Ya ofcourse thanx a lot for help..
Ranjit
INDIA
Re: Display rectangle on Image
I don't know whether i understood your problem correctly or not.
I think you can accomplish your task by inheriting QLabel and reimplement paintEvent something like
Code:
{
public:
...
{
//setup painter
painter->drawRect(..);
}
};