Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, May 2008
hw can i set and get the color of the pixel on screen clicked by mouse,inqt4


Message 1 in thread

hi all
can any one suggest hw to do this below .
i want to set and get the color of  the pixel on screen clicked by mouse.
i m using qt4.3 in ubuntu linux.
-- 
 [ signature omitted ] 

Message 2 in thread

HI Bijay 

> i want to set and get the color of  the pixel on screen clicked by mouse.

get the mouse position:

void QWidget::grabMouse ()
QMouseEvent::globalPos ()

i think there was some better way, but my assistant is currently borked 
*shrug*

grab the pixel:

QPixmap grabWindow(QApplication::desktop()->winId(), pos.x(),pos.y(),1,1);

access it:

QRgb QImage::pixel ( const QPoint & position ) const



you can't SET a pixel, but you can paint on screen using QDesktopWidget.


-- 
 [ signature omitted ]