Hi,
GrayValue = 0.299*R + 0.587*G + 0.114*B1.) How can I get the grey level value of the pixel that is pointed by the mouse? I only managed to obtain the rgb value through “QRgb rgbValue = pix.toImage().pixel(x,y)â€. How can I convert it into grey level value? Or is there any direct way to get the grey level value of the pixel.
You have to use the "mouseMoveEvent" of the QGraphicsItem instead of MainWindow.2.) I have implemented “mouseMoveEvent(QMouseEvent *event)†and “setMouseTracking(true)â€. However the function of “mouseMoveEvent(QMouseEvent *event)†is not functioning when I move the mouse. What is wrong with my code?
Bookmarks