Click here to Skip to main content
15,867,686 members
Articles / Desktop Programming / MFC
Article

Xgui - A set of Photoshop-like color pickers

Rate me:
Please Sign up or sign in to vote.
4.50/5 (5 votes)
15 May 2002 67.9K   2K   24   3
An MFC Compliant adobe Photoshop-like Color Picker from xgui

Introduction

Bobi B has written a very cool Photoshop-like color picker (you can click here to see how cool it is), but since this is compiled into a DLL, it is very hard to use with existing MFC projects. I decided therefore to create a simple class to mimic CGTColorDialogDlg - but this time based on CDialog.

Sample Image - xgui-extension.jpg

How to use it:

Very easy! Simply add the following code in the header file of the class where you want to display the Color Picker Dialog:

#include "GTColorDialogDlg.h"

And in the .cpp file:

CGTColorDialogDlg dlg
dlg.SetColor(RGB(0,0,255));
int nResponse = dlg.DoModal()
if (nResponse == IDOK)
{
    COLORREF crReturn = dlg.GetColor();
}

Technical Details

The Color Picker Dialog is constructed using the following classes:

  1. GTColorWellWnd - (GTColorWellWnd.h, GTColorWellWnd.cpp)
  2. GTColorSliderWnd - (GTColorSliderWnd.h,GTColorSliderWnd.cpp)
  3. GTColorSelectorWnd - (GTColorSelectorWnd.h,GTColorSelectorWnd.cpp)
  4. CGTColorDialogDlg - (CGTColorDialogDlg.h,CGTColorDialogDlg.cpp

The class inheritance diagrams are as follows:

Sample Image - A_Hierarchy_Chart.jpg

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
jack Mesic is the president of UCanCode Software Technology,Inc..

Comments and Discussions

 
GeneralStrange crash...solved. Pin
Andreas Muegge16-Sep-02 5:39
Andreas Muegge16-Sep-02 5:39 
GeneralLooks nice. Pin
11-Apr-02 22:16
suss11-Apr-02 22:16 
GeneralThanks a lot Pin
11-Apr-02 22:14
suss11-Apr-02 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.