Important alert: (current site time 7/15/2013 5:05:07 PM EDT)
 

article

A COOL Picker Library with full Source Code

Email
Submitted on: 6/8/2005 7:10:21 AM
By: ucancode software  
Level: Intermediate
User Rating: By 1 Users
Compatibility: Microsoft Visual C++
Views: 11009
(About the author)
 
     Author homepage: UCanCode Software (www.ucancode.net) Picker Library V1.8 Introduction File reference: Prebuild version: Picker18_exe.zip 120 KB (A dialog for choosing colors) Class Ref: PickerLib18.chm 119KB (Build by UCanCode DocVizor) Source Code:Picker18_src.zip 65KB (Build with MS Visual C++ 6.0)


 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				The key features are as follows:
1.ColorPicker provides a default color panel, which includes over 144 frequent colors.
2.ColorPicker provides a custom button for opening Windows Common Color Select Dialog. You can select more color here.
3.ColorPicker provides the color contrast between current selection and new selection.
4.ColorPicker provides a select button, when you hold the left button of mouse on select button, the cursor has become to a color dropper like Photoshop and Frontpage 2000. You can get any color on the screen via this dropper.
5.ColorPicker shows both the RGB value and Hex Value of the current selection color.
6.The color panel will load new palette as soon as the system color range has been changed.
7.ColorDropper provides 6 color panels for choosing. You can change it during run time.
8.(New)Full keyboard support.
9.Add a new Line Picker it also includes Full keyboard support.
9.The most important thing is that, we provide the full source code (100% MFC), ¡­.
How to use it:
 The steps for usage are as follows:
1.Add code in those head files where you want to display Color Picker Dialog.
#include "FODropColorButton.h"
enum { IDD = IDD_DIALOG_COLORPICKER };
CFODropColorButton m_wndColor3;
CFODropColorButton m_wndColor2;
CFODropColorButton m_wndColor1;
CFODropLineTypeButton m_wndLinePicker2;
CFODropLineTypeButton m_wndLinePicker1;
CFOHyperLink m_newVersion;
//}}AFX_DATA
 
2.Add code in those files/events when you need to get color value.
//{{AFX_DATA_MAP(CNewPickerDlg)
DDX_Control(pDX, IDC_FO_TEST_BUTTON5, m_wndLinePicker2);
DDX_Control(pDX, IDC_FO_TEST_BUTTON4, m_wndLinePicker1);
DDX_Control(pDX, IDC_FO_TEST_BUTTON3, m_wndColor3);
DDX_Control(pDX, IDC_FO_TEST_BUTTON2, m_wndColor2);
DDX_Control(pDX, IDC_FO_TEST_BUTTON1, m_wndColor1);
DDX_Control(pDX, IDC_NEWVERSION, m_newVersion);
//}}AFX_DATA_MAP
DDX_FODropColorButton(pDX,IDC_FO_TEST_BUTTON1,crColor1);
DDX_FODropColorButton(pDX,IDC_FO_TEST_BUTTON2,crColor2);
DDX_FODropColorButton(pDX,IDC_FO_TEST_BUTTON3,crColor3);
DDX_FODropLineTypeButton(pDX,IDC_FO_TEST_BUTTON4,m_nLineType1);
DDX_FODropLineTypeButton(pDX,IDC_FO_TEST_BUTTON5,m_nLineType2);
 
Everything is OK!
Technical Details
 Color Picker Dialog is constructed with classes as follows;
1.CFOColorButton File Reference£ºFOColorButton.h, FOColorButton.cpp
2.CFODropLineTypeButton File Reference£ºFODropLineTypeButton.h, FODropLineTypeButton.cpp
3.CFOColorCellObj File Reference£ºFOColorCellObj.h, FOColorCellObj.cpp
4.CFOLineTypeCellObj File Reference£ºFOLineTypeCellObj.h, FOLineTypeCellObj.cpp
4.CFOColorDialog File Reference£ºFOColorDialog.h, FOColorDialog.cpp
5.CFOColorPaletteControl File Reference£ºFOColorPaletteControl.h, FOColorPaletteControl.cpp
6.CFOLineTypeControl File Reference£ºFOLineTypeControl.h, FOLineTypeControl.cpp
7.CFODropPaletteWndFile Reference£ºFODropPaletteWnd.h, FODropPaletteWnd.cpp
8.CFODropColorButton File Reference£ºFODropColorButton.h, FODropColorButton.cpp
9.CFODropColorPaletteControl File Reference£ºFODropColorPaletteControl.h, FODropColorPaletteControl.cpp
10.CFODropColorPaletteWnd File Reference£ºFODropColorPaletteWnd.h, FODropColorPaletteWnd.cpp
11.CFOPopupColorPaletteWndFile Reference£ºFOPopupColorPaletteWnd.h, FOPopupColorPaletteWnd.cpp
All of the class inheritance diagrams are as follows:
CWnd
CObject
CStatic
CButton
CDialog
Click here to view Our online profile and report bugs.
Update V1.8(New!)
We have change the name of this toolkit. 
Add a new line picker. 
Add full keyboard supprt,you can use left arrow,right arrow,up arrow,down arrow and tab key to select color. 
Fixed a few bugs. 
Update V1.6(New!)
Add full keyboard supprt,you can use left arrow,right arrow,up arrow,down arrow and tab key to select color. 
Fixed a few bugs. 
Update V1.5
Add color palette support for color dialog. 
Add a cool drop color picker button. 
Fixed a few bugs. 
Update V1.2
Add a specify image static class. 
Add support 3D color table. 
Fixed a few bugs. 
http://www.ucancode.net/download/ColorPicker/Picker18_exe.zip
http://www.ucancode.net/download/ColorPicker/Picker18_src.zip


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
6/17/2005 2:11:05 PM

oki doki
(If this comment was disrespectful, please report it.)

 
6/17/2005 2:12:12 PM

dfdferr
(If this comment was disrespectful, please report it.)

 
6/30/2008 10:19:07 PMash

nice
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.