Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the windows color picker

Status
Not open for further replies.

lasse

Programmer
Jul 11, 2000
1
NO
Do any of you gurus know how to get the windows colorpicker on screen and return a value from it???<br><br>Lasse
 
Hi Lasse,<br><br>Check out the GetColor() function.<br><br><i>Displays the Windows Color dialog box and returns the color number of the chosen color.</i><br><br>It's like you formulated your question from the function description.&nbsp;&nbsp;:)<br><br>Jon <p>Jon<br><a href=mailto: > </a><br><a href= > </a><br>Carpe Diem!
 
*-- Lasse<br>*<br>*-- If you need to return the RBG Values from the no <br>*-- returned by GETCOLOR(), the following program/code <br>*-- may help<br><br>CLEA<br>STORE 0 to r,g,b<br>getRGB(getColor(),@r,@g,@b)<br><br>? r && The R&nbsp;&nbsp;&nbsp;value<br>? g && The&nbsp;&nbsp;G&nbsp;&nbsp;value<br>? b && The&nbsp;&nbsp;&nbsp;B value<br><br>**********************************<br>PROCEDURE getRGB(ColorNo,red,green,blue)<br><br>PRIVATE p,i<br><br>p = (256 ^ 2)<br>i = INT(ColorNo / p)<br>blue = i<br>ColorNo = ColorNo - (i * p)<br>p = (256 ^ 1)<br>i = INT(ColorNo / p)<br>green = i<br>ColorNo = ColorNo - (i * p)<br>red = INT(ColorNo)<br><br><br>* Chris<br>* EOF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top