mirror of
https://github.com/greenshot/greenshot
synced 2025-07-15 01:23:47 -07:00
Just a small change to make sure the palette doesn't have "garbage" at the unused entries.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2452 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
2730ac5540
commit
cdcd051153
1 changed files with 6 additions and 2 deletions
|
@ -214,8 +214,12 @@ namespace GreenshotPlugin.Core {
|
||||||
|
|
||||||
// generates palette
|
// generates palette
|
||||||
ColorPalette imagePalette = resultBitmap.Palette;
|
ColorPalette imagePalette = resultBitmap.Palette;
|
||||||
for (Int32 paletteIndex = 0; paletteIndex < colorCount; paletteIndex++) {
|
for (Int32 paletteIndex = 0; paletteIndex < 256; paletteIndex++) {
|
||||||
imagePalette.Entries[paletteIndex] = colors[paletteIndex];
|
if (paletteIndex < colorCount) {
|
||||||
|
imagePalette.Entries[paletteIndex] = colors[paletteIndex];
|
||||||
|
} else {
|
||||||
|
imagePalette.Entries[paletteIndex] = Color.Black;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
resultBitmap.Palette = imagePalette;
|
resultBitmap.Palette = imagePalette;
|
||||||
return resultBitmap;
|
return resultBitmap;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue