]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/palette.cpp
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "palette.h"
16 #include "wx/palette.h"
18 IMPLEMENT_DYNAMIC_CLASS(wxPalette
, wxGDIObject
)
25 wxPaletteRefData::wxPaletteRefData()
30 wxPaletteRefData::~wxPaletteRefData()
35 wxPalette::wxPalette()
39 wxPalette::wxPalette(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
)
41 Create(n
, red
, green
, blue
);
44 wxPalette::~wxPalette()
48 bool wxPalette::FreeResource(bool force
)
50 if ( M_PALETTEDATA
&& M_PALETTEDATA
->m_hPalette
)
52 DeleteObject((HPALETTE
)M_PALETTEDATA
->m_hPalette
);
57 bool wxPalette::Create(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
)
61 m_refData
= new wxPaletteRefData
;
68 int wxPalette::GetPixel(const unsigned char red
, const unsigned char green
, const unsigned char blue
) const
77 bool wxPalette::GetRGB(int index
, unsigned char *red
, unsigned char *green
, unsigned char *blue
) const
82 if (index
< 0 || index
> 255)