Hi,
Someone in irc reported an issue with the mbColorLib TmbDeskPickerButton returning the wrong color on Windows. Eg, you select black(0) and it returns 65793(RGB: 010101).
I debugged the problem and realised `TScreenForm` with a `AlphaBlendValue := 1` affects the
`ScreenWin.GetDesktopColor` method.
Setting `TScreenForm.AlphaBlendValue := 0` does not work because this "hide" the window so no selection can take place. Also calling `TScreenForm.Hide`, then `GetDesktopColor`, and then `TScreenForm.Show` creates a lot of flickering on screen.
So I then decided to rename
`ScreenWin.GetDesktopColor` to `ScreenWin.GetScreenColor` and add a private method to `TScreenForm` as follow and that seems to do the trick:
function TScreenForm.GetDesktopColor(const X, Y: Integer): TColor;
begin
{$IFDEF MSWINDOWS}
AlphaBlendValue:= 0;
{$ENDIF}
Result := GetScreenColor(X, Y);
{$IFDEF MSWINDOWS}
AlphaBlendValue:= 1;
{$ENDIF}
end;
I don't have the lcl components source code checked out on my machine so I just modified mbColorLib I sourced from OPM.
But I think we need to be aware of the problem and hopefully apply my suggested fix to it, after someone also confirms this was the issue.
Hence this post,
Thanks.
edit: added OS Target switch to suggested change to only affect Windows Platforms.