Hello all,
I Have one Qlabel in which I m displaying one .PNG image using QPixmap.
Now my program needs to draw few horizontal lines over this image..
How to add it?????
Hello all,
I Have one Qlabel in which I m displaying one .PNG image using QPixmap.
Now my program needs to draw few horizontal lines over this image..
How to add it?????
Hi, subclass QLabel and reimplemented QWidget::paintEvent ( QPaintEvent * event ). First pas the event to QLabel and then draw your lines using QPainter p(this);
Lykurg
EDIT: you also could modify your picture since QPixmap is a QPaintDevice. QPainter p(*yourPixmap);
or if you don't want to sublcass QLabel you can install event filter on your label and process QPainEvent.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Hey could you please show me some code how to do this stuff??????
try this
Qt Code:
QPixmap p; painter.drawLine(line); label->setPixmap(p);To copy to clipboard, switch view to plain text mode
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Qt Code:
p->drawLine(pix.rect().topLeft(),pix.rect().bottomRight()); //use pix normaly...To copy to clipboard, switch view to plain text mode
Ok, I am out. spirit you get me one more time...
Hey thanx both of you,
Its working now !!!!!!!!!!
Bookmarks