Page 1 of 1

Point(x,y) returns wrong collor

Posted: Tue Jul 07, 2020 6:48 pm
by dibor
Hello.
Point(x,y) returns right color under Windows, but wrong color under Linux and Mac OS
From same source - under Windows I got C0C0C0 color ,under Linux - 3C0000.
x,y coordinates is doesn't matter.

Best Wishes.

// Moved from "Bugs - Linux" to "Linux" (Kiffi)

Re: Point(x,y) returns wrong collor

Posted: Tue Jul 07, 2020 11:04 pm
by IdeasVacuum
Hello dibor

Windows defaults to RGB format. Perhaps Linux and MAC are using a different format/colour space?

Edit: Apple's own colour picker has issues (or at least confusion):
https://apple.stackexchange.com/questio ... oose-color

Re: Point(x,y) returns wrong collor

Posted: Wed Jul 08, 2020 6:58 am
by dibor
Hi.
Tnx for answer.
I am do not care about color formats.
Compiler mast to care.
Point function supported by ALL OS's, so I do not need to do any manipulation for getting pixel color in any OS

Code: Select all

  If StartDrawing(WindowOutput(#Window_MainWindow)) ; 
    WinBackColor = Point(0,0)
    Debug WinBackColor
    StopDrawing()
  EndIf 
May be I am wrong or do not understand something :(

Re: Point(x,y) returns wrong collor

Posted: Wed Jul 08, 2020 8:45 am
by Bisonte
in this case ... you have to "eat" all events on Linux and Mac, if this "GetWindowColor" is directly after Windowcreation !

Only after the events from the creation process are done, you can read the color. On windows you don't need it, but on the other os.

Code: Select all

  While WindowEvent() : Wend
  If StartDrawing(WindowOutput(#Window_MainWindow)) ;
    WinBackColor = Point(0,0)
    Debug WinBackColor
    StopDrawing()
  EndIf

Re: Point(x,y) returns wrong collor

Posted: Wed Jul 08, 2020 9:31 am
by dibor
Bisonte wrote:i, if this "GetWindowColor" is directly after Windowcreation !
Sure, I am take windows color and put it as background color of the canvas buttons.

Re: Point(x,y) returns wrong collor

Posted: Wed Jul 08, 2020 12:23 pm
by infratec
That's not what Bisonte wrote.

On Linux and OSX you have to wait until the window creation is complete before you can read the color.
So you have to add a short delay and wait until all (first) window events are finished, like Bisonte wrote in his example.

Re: Point(x,y) returns wrong collor

Posted: Wed Jul 08, 2020 12:33 pm
by dibor
Thank you are Bisonte and infratec
Will try to do so, hope this hepls :)

Re: Point(x,y) returns wrong collor

Posted: Wed Jul 08, 2020 12:45 pm
by dibor
Thank you again to Bisonte and infratec

Code: Select all

While WindowEvent() : Wend
Did it !!! :)

So this is not a bug this is unknowing programming under Linux and OSX(and Windows also) :(
I am amateur in the programming.
Thank you are again :)

Re: Point(x,y) returns wrong collor

Posted: Sun Aug 09, 2020 9:45 pm
by Kiffi
@dibor: No problem. But in the future you should always have bugs confirmed by others before posting them in the bug forum.

Greetings ... Peter