Added version of Quantize that manages the palette itself
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1562,3 +1562,23 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, wxPalette** pPalett
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// This version sets a palette in the destination image so you don't
|
||||
// have to manage it yourself.
|
||||
|
||||
bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, int desiredNoColours,
|
||||
unsigned char** eightBitData, int flags)
|
||||
{
|
||||
wxPalette* palette = NULL;
|
||||
if (Quantize(src, dest, & palette, desiredNoColours, eightBitData, flags))
|
||||
{
|
||||
if (palette)
|
||||
{
|
||||
dest.SetPalette(* palette);
|
||||
delete palette;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user