It is currently Wed Jan 27, 2021 8:22 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Point(x,y) returns wrong collor
PostPosted: Tue Jul 07, 2020 6:48 pm 
Offline
User
User

Joined: Wed May 20, 2020 5:19 pm
Posts: 29
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)


Top
 Profile  
Reply with quote  
 Post subject: Re: Point(x,y) returns wrong collor
PostPosted: Tue Jul 07, 2020 11:04 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 6287
Location: Wales, UK
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/questions/305695/output-format-of-the-standard-mac-os-color-picker-dialog-choose-color

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Point(x,y) returns wrong collor
PostPosted: Wed Jul 08, 2020 6:58 am 
Offline
User
User

Joined: Wed May 20, 2020 5:19 pm
Posts: 29
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:
  If StartDrawing(WindowOutput(#Window_MainWindow)) ;
    WinBackColor = Point(0,0)
    Debug WinBackColor
    StopDrawing()
  EndIf


May be I am wrong or do not understand something :(


Top
 Profile  
Reply with quote  
 Post subject: Re: Point(x,y) returns wrong collor
PostPosted: Wed Jul 08, 2020 8:45 am 
Offline
Addict
Addict
User avatar

Joined: Tue Oct 09, 2007 2:15 am
Posts: 1151
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:
  While WindowEvent() : Wend
  If StartDrawing(WindowOutput(#Window_MainWindow)) ;
    WinBackColor = Point(0,0)
    Debug WinBackColor
    StopDrawing()
  EndIf

_________________
PureBasic 5.72 LTS (Windows x86/x64) | Windows10 Pro x64 | Z370 Extreme4 | i7 8770k | 64GB RAM | iChill GeForce RTX 2080 Super | HAF XF Evo​​
English is not my native language... (I often use DeepL to translate my texts.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Point(x,y) returns wrong collor
PostPosted: Wed Jul 08, 2020 9:31 am 
Offline
User
User

Joined: Wed May 20, 2020 5:19 pm
Posts: 29
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Point(x,y) returns wrong collor
PostPosted: Wed Jul 08, 2020 12:23 pm 
Offline
Always Here
Always Here

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 5219
Location: Germany
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.


Last edited by infratec on Wed Jul 08, 2020 12:35 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Point(x,y) returns wrong collor
PostPosted: Wed Jul 08, 2020 12:33 pm 
Offline
User
User

Joined: Wed May 20, 2020 5:19 pm
Posts: 29
Thank you are Bisonte and infratec
Will try to do so, hope this hepls :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Point(x,y) returns wrong collor
PostPosted: Wed Jul 08, 2020 12:45 pm 
Offline
User
User

Joined: Wed May 20, 2020 5:19 pm
Posts: 29
Thank you again to Bisonte and infratec
Code:
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 :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Point(x,y) returns wrong collor
PostPosted: Sun Aug 09, 2020 9:45 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Mar 02, 2004 1:20 pm
Posts: 1165
Location: Amphibios 9
@dibor: No problem. But in the future you should always have bugs confirmed by others before posting them in the bug forum.

Greetings ... Peter

_________________
Hygge


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye