|
Visual Color Picker SDK
Visual Color Picker can be easily integrated into a program.
Below is an example of how to load ColorPicker.dll
and use its dialog function. Note, you should download and install Visual Color Picker 1.3.
Then find ColorPicker.dll and put it in your folder.
Contact
us if you would like to distribute your software with our Color Picker.
////////////////////////////////////////////////////////////////////////////////////////////
// C++ sample on how to open Visual Color Picker dialog
//
class CColorRGBA
{
public:
CColorRGBA()
{
ASSERT(sizeof(CColorRGBA) == 4);
b = g = r = a = 0;
}
BYTE b, g, r, a;
};
typedef UINT (*PickColor)(CWnd *pParent, CColorRGBA & colText, CColorRGBA & colBk);
UINT PickRGBColor(CColorRGBA & colText, CColorRGBA & colBk)
{
// Load Visual Color Picker DLL
HINSTANCE hModule = ::LoadLibrary(_T("ColorPicker.dll"));
if (!hModule)
return (UINT)-1;
// Get Visual Color Picker function
PickColor func = (PickColor)::GetProcAddress(hModule, "PickColor");
if (!func)
{
::FreeLibrary(hModule);
return (UINT)-2;
}
// call Visual Color Picker dialog function
UINT ret = func(NULL, colText, colBk); // returns IDCANCEL, IDOK
::FreeLibrary(hModule);
return ret;
}
//
// end of sample code.
////////////////////////////////////////////////////////////////////////////////////////////
|