Solved Scan for a color of a QLabel
-
Hello, I wanted to create a car-racing game, where the player should only be allowed to drive on the road, so I came up with the idea of scanning the beneath QLabel for a certain color.
I searched up in the internet and found no solution, I also looked at every QLabel functions but i cant find such a function.
So I am asking, is it possible to do this or should I try finding another solution?Also the Car is another QLabel which moves on the road-QLabel (the road is almost like a background).
-
What does 'color of a QLabel' means - the background color? The text color, the frame color?
-
I assigned a Pixmap to the Label and i want to check certain pixels for a certain color.
-
Then get the pixmap from the label and check it's pixels.
-
@Qt-User0307
AQLabel
is aQWidget
. Widget applications are usually oriented towards applications which present text and input boxes to a user. Although you can put a pixmap in a label, for a "car-racing game" it would not be an obvious choice to me. Depending on your intentions, you might want to consider Qt's Graphics View Framework instead. -
@Qt-User0307 How do you get this PIXMAP?Where does this PIXMAP`s source data come from and what kind of data is it?