Pixel eines Fensters an bestimmter Position
-
ok, scheint doch noch nicht so ganz zu funktionieren...
kann es sein, dass getpixel für bestimmte bereiche immer den gleichen wert zurueckgibt ?
-
habe grad geschaut wie groß COLORREF maximal ist, nämlich: 4294967295
kann es sein... dass der Wert außerhalb der für COLORREF bestimmten Range von
-2147483648 bis +2147483647 liegt ?Achja diese Zahl taucht aber nur auf für einen bestimmten Bereich innerhalb des Fensters myhwnd, andere bereiche lassen sich einwandfrei auslesen. Woran kann das liegen?
-
The return value is the RGB value of the pixel. If the pixel is outside of the current clipping region, the return value is CLR_INVALID.
-
Hm... sieht wohl os aus, als würde ich hängenbleiben...
Ähm gibts irgendwie ne Möglichkeit vom kompletten Screen ein Bild zu erzeugen und dann davon an selbiger Position die Pixelfarbe abzulesen?
-
So konnte dank Schritt-für-Schritt rausfinden, wo genau der Fehler liegt.
Also es liegt an der y-Koordinate...
für werte < 600 (z.B.: 599) funktioniert GetPixel
für werte >= 600 bekomm ich wieder 4294967295...Ich überlege grad ob es mit dem Fenster zusammenhängen kann.
-
If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID.
-
At which point the clipping region will be set?
-
If the pixel is inside the current clipping region as defined by the device context.
sincerely,
Wilhelm
-

-
alles klar, habs eben selbst rausgefunden...
Habe ZeileHDC mydc = GetDC(myhwnd);durch
HDC mydc = GetWindowDC(myhwnd);ersetzt.
Special THX to Wilhelm for his endurance
