Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
slt la couleur de fond par défaut d'une fenêtre est backcolor = 134217751
s'est pour savoir en rgb(x,x,x) sa donne quoi merci d'avance
Hors ligne
RGB = 65536 * B + 256 * G + R
donc il faut faire successivement des divisions entières par 65536 et 256 pour trouver B, G et R
EDIT : ton nombre est supérieur à RGB(256,256,256), ça doit être une couleur "spéciale" de windows
http://pbadonf.fr/forum/viewtopic.php?id=141
Hors ligne
Plus simple encore, il y a
http://www.iconico.com/colorpic/
outil indispensable dont je ne peux plus me passer, oh combien de foi il m'a rendu des services... :-)
Vincent
Hors ligne
Message de modération:
Bonjour azreil,
Merci de poster tes messages dans le bon topic, et de mettre à [RESOLU]
tes topics quand ils sont cloturés.
Hors ligne
Voici une ébauche de solution a toi de la completer.
long ll_res Constant long COLOR_SCROLLBAR = 0 Constant long COLOR_BACKGROUND = 1 Constant long COLOR_ACTIVECAPTION = 2 Constant long COLOR_INACTIVECAPTION = 3 Constant long COLOR_MENU = 4 Constant long COLOR_WINDOW = 5 //'Windows background Constant long COLOR_WINDOWFRAME = 6 //'Window frame Constant long COLOR_MENUTEXT = 7 //'Window Text Constant long COLOR_WINDOWTEXT = 8 //'3D dark shadow (Win95) Constant long COLOR_CAPTIONTEXT = 9 //'Text in window caption Constant long COLOR_ACTIVEBORDER = 10 //'Border of active window Constant long COLOR_INACTIVEBORDER = 11 //'Border of inactive window Constant long COLOR_APPWORKSPACE = 12 //'Background of MDI desktop Constant long COLOR_HIGHLIGHT = 13 //'Selected item background Constant long COLOR_HIGHLIGHTTEXT = 14 //'Selected menu item Constant long COLOR_BTNFACE = 15 //'Button Constant long COLOR_BTNSHADOW = 16 //'3D shading of button Constant long COLOR_GRAYTEXT = 17// 'Grey text, of zero if dithering is used. Constant long COLOR_BTNTEXT = 18 //'Button text Constant long COLOR_INACTIVECAPTIONTEXT = 19// 'Text of inactive window Constant long COLOR_BTNHIGHLIGHT = 20 //'3D highlight of button Constant long COLOR_2NDACTIVECAPTION = 27 //'Win98 only: 2nd active window color Constant long COLOR_2NDINACTIVECAPTION = 28 //'Win98 only: 2nd inactive window color Constant long COLOR_INFOBK =24 Constant long COLOR_INFOTEXT =23 Constant long COLOR_3DLIGHT =22 Constant long COLOR_3DSHADOW =21 if p_color < RGB(255,255,255) then return p_color choose case p_color case 2^25 //Window text ll_res= GetSysColor(COLOR_MENUTEXT) case 2^26 //buttonface ll_res= GetSysColor(COLOR_BTNFACE) case 2^27 //scroll bar background ll_res= GetSysColor(COLOR_SCROLLBAR) case 2^28 //apllication workspace ll_res= GetSysColor(COLOR_APPWORKSPACE) case 2^29 //transparent ll_res= RGB(255,255,255) // discutable case 2^30 //WindowBackgroud ll_res= GetSysColor(COLOR_BACKGROUND) case 134217752 // tootil ll_res= GetSysColor(COLOR_INFOBK) case 134217737 // active title bar text ll_res= GetSysColor(COLOR_MENU) case else RGB(255,255,255) end choose return ll_res
Hors ligne
LONG ll_red,ll_green,ll_blue,ll_color ll_red = MOD(ll_color,256) ll_green = MOD(ll_color/256,256) ll_blue = INT(ll_color/256^2))
Dernière modification par BRWA (16-04-2009 13:02:07)
Hors ligne