ColorPicker.dll
*Pick RGB colors from any place of the screen.


Table of contents

1: What is it?

2: This Archive Contents

3: Installation

4: Testing

5: Software development

6: More...



1: What is it?

ColorPicker.dll is a free and easy way to add a "color capture" control to your application. This library may be distributed with your application and helps your users to pick RGB colors from any place of the screen. You can play with supplied Test application to see the library in work.

Sure, as well as any other freeware, it has some "hidden goals": I want to show you my ability and intentions to develop various (and much more complex) "spare parts" and tools for software developers. Feel free to suggest ideas of new libraries, Delphi components and ActiveX controls just please take a moment to see what is already done.


 « Contents 


2: This Archive Contents

After you download the archive, you need to UnZip or UnRar it into a separate folder. Your folder will contain the following subfolders after extraction:

  Install - Contains "pure" library installation.
    DLL - Setup files of ColorPicker.dll. Run Install.bat.
  Source - Borland Delphi source files of the product.
    DLL - Source files of the ColorPicker dynamic-link library.
  Test - Test user interface for quick product evaluation.
    DLL - Classic DLL example. source for the first try.

 « Contents 


3: Installation

Open the \Install\DLL folder and execute Install.bat. ColorPicker.dll will be copied to your System32 folder to be available from any place of your computer. The same operation is necessary when your application deploying on the target computer as the library should be accessible for it.



 « Contents 


4: Testing

Test directory contains usage example for quick evaluation of this product. Please open \Test\DLL example, run Test.exe and press the "Pick Color..." button.


 « Contents 


5: Software development

C++ Developers: The library contains only one standard ("stdcall") function which accepts three byte parameters by reference and returns boolean value that occupies four bytes.


ColorPicker library contains only one function:

PickColor()

This function receives three Byte parameters passed by reference as it usually works in VB. Each parameter represents Red, Green and Blue constituents of the selected color.

If user clicks the left mouse button or hits Enter key during the color selection, this function returns True and each color constituent is changing to the selected color value. When there is no color picked (Esc key or right mouse button pressed), the function returns False.


...If we use a VB notation, the PickColor function declared as


   Private Declare Function _
   PickColor Lib "ColorPicker" ( _
                                Red   As Byte, _
                                Green As Byte, _
                                Blue  As Byte _
                               ) As Boolean
          

VB example of use:


   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   ' PickColor() function: Visual Basic Example.
   '
   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   ' REM: Please declare PickColor function as it is shown above.
   ' The library should be available to your application at 
   ' least by environment %PATH% variable. You can just copy 
   ' ColorPicker.dll to the system folder (C:\WINDOWS or C:\WINNT).
   '
   ' Use RGB() function to get standard color value.
   '
   Sub PickMyColor()
       Dim Red As Byte, _
           Green As Byte, _
           Blue As Byte

       If PickColor(Red, Green, Blue) = True Then
          MsgBox ("Red:" & Str(Red) & ", Green:" & Str(Green) & ", Blue:" & Str(Blue))
       Else
          MsgBox ("No color picked.")
       End If

   End Sub
   
          


6: More...

Feel free to download more tools from VANDOG and e-mail me from the contact page.

- Igor Kovalevsky

www.vandog.com




 « Contents 


© Copyright: VANDOG Software      Programming: Igor Kovalevsky.