fix XPM SaveFile for more than 92 colors
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47088 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -181,6 +181,7 @@ All (GUI):
|
|||||||
- Fixed freeing of "static" alpha data in wxImage (Axel Gembe)
|
- Fixed freeing of "static" alpha data in wxImage (Axel Gembe)
|
||||||
- Don't invalidate the font in SetNativeFontInfo[Desc]() if the string is
|
- Don't invalidate the font in SetNativeFontInfo[Desc]() if the string is
|
||||||
invalid, to conform to the documented behaviour (Langhammer)
|
invalid, to conform to the documented behaviour (Langhammer)
|
||||||
|
- Fixed wxXPMHandler::SaveFile for images with more than 92 colors.
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -181,12 +181,10 @@ bool wxXPMHandler::SaveFile(wxImage * image,
|
|||||||
symbols[index] = symbols_data + index * (chars_per_pixel+1);
|
symbols[index] = symbols_data + index * (chars_per_pixel+1);
|
||||||
char *sym = symbols[index];
|
char *sym = symbols[index];
|
||||||
|
|
||||||
k = index % MaxCixels;
|
for (j = 0; j < chars_per_pixel; j++)
|
||||||
sym[0] = Cixel[k];
|
|
||||||
for (j = 1; j < chars_per_pixel; j++)
|
|
||||||
{
|
{
|
||||||
k = ((index - k) / MaxCixels) % MaxCixels;
|
sym[j] = Cixel[index % MaxCixels];
|
||||||
sym[j] = Cixel[k];
|
index /= MaxCixels;
|
||||||
}
|
}
|
||||||
sym[j] = '\0';
|
sym[j] = '\0';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user