Here is the code that I use. But I always shows me the value "192" for every color(Red, Green, Blue)
Even if I change my windows' color, it stays the same:
I am drawing the text when the left button is clicked. So I also have problem with the PAINT event because whenever I resize my window, it just repaints the whole area and I loose my text.Code:case WM_LBUTTONDOWN: Colors = GetPixel(GetWindowDC(ChildWindowFromPoint(WindowFromPoint(Mouse), Mouse)), Mouse.x, Mouse.y); Red = GetRValue(Colors); //contains red value Green = GetGValue(Colors); //contains green value Blue = GetBValue(Colors); //contains blue value hdc = GetDC(hwnd); TextOut(hdc, 30,50,itoa(Red, buffer,10), 3); TextOut(hdc, 80,50,itoa(Blue, buffer1,10), 3); TextOut(hdc, 130,50,itoa(Green, buffer2,10), 3); ReleaseDC(hwnd, hdc); return 0;
How can I fix both of these?




Reply With Quote