Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[dad864]: PaletteEdit.h Maximize Restore History

Download this file

PaletteEdit.h    100 lines (91 with data), 2.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#if !defined(AFX_PALETTEEDIT_H__0AE18A95_5667_436B_9AE3_D3FE29B22FEA__INCLUDED_)
#define AFX_PALETTEEDIT_H__0AE18A95_5667_436B_9AE3_D3FE29B22FEA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PaletteEdit.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CPaletteEdit dialog
class CPaletteEdit : public CDialog
{
// Construction
public:
CPaletteEdit(CWnd* pParent = NULL); // standard constructor
inline void SetPalette(unsigned long *pal, int function, COLORREF adjust)
{
palette=pal;
m_function=function;
m_xr=GetRValue(adjust);
m_xg=GetGValue(adjust);
m_xb=GetBValue(adjust);
}
inline COLORREF GetAdjustment()
{
return RGB(m_xr, m_xg, m_xb);
}
// Dialog Data
//{{AFX_DATA(CPaletteEdit)
enum { IDD = IDD_PALETTE };
CStatic m_palette_control;
BYTE m_green;
BYTE m_blue;
BYTE m_red;
BYTE m_from;
BYTE m_to;
int m_function;
BOOL m_keepgray;
BYTE m_xr;
BYTE m_xg;
BYTE m_xb;
//}}AFX_DATA
int m_max;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPaletteEdit)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CToolTipCtrl m_tooltip;
CColorDialog dlg;
RGBQUAD colorbits[16*16*16*16];
CPoint mousepoint;
CPoint mypoint;
HWND palettehwnd;
unsigned long *palette;
int m_nStep;
int *m_pSteps; //custom script for palette modifications
void InitPaletteBitmap();
int ExecuteScript(int &fr, int &fg, int &fb, int &ftmp);
void ExecuteStep(int &fr, int &fg, int &fb, int &ftmp, int function);
// Generated message map functions
//{{AFX_MSG(CPaletteEdit)
virtual BOOL OnInitDialog();
afx_msg void OnPalette2();
afx_msg void OnPalette();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnKillfocusBlue();
afx_msg void OnKillfocusGreen();
afx_msg void OnKillfocusRed();
afx_msg void OnKillfocusIdx();
afx_msg void OnKillfocusFrom();
afx_msg void OnKillfocusTo();
afx_msg void OnSmooth();
afx_msg void OnKillfocusFunction();
afx_msg void OnRgb();
afx_msg void OnAll();
afx_msg void OnKeepgray();
afx_msg void OnKillfocusBlue2();
afx_msg void OnKillfocusGreen2();
afx_msg void OnKillfocusRed2();
afx_msg void OnSwap();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PALETTEEDIT_H__0AE18A95_5667_436B_9AE3_D3FE29B22FEA__INCLUDED_)