Swaps two specified palette indices on a 1-, 4- or 8-bit palletized image.

Namespace:  FreeImageAPI
Assembly:  FreeImageNET (in FreeImageNET.dll)

Syntax

C#
public static uint SwapPaletteIndices(
	FIBITMAP dib,
	ref byte index_a,
	ref byte index_b
)
Visual Basic (Declaration)
Public Shared Function SwapPaletteIndices ( _
	dib As FIBITMAP, _
	ByRef index_a As Byte, _
	ByRef index_b As Byte _
) As UInteger
Visual C++
public:
static unsigned int SwapPaletteIndices(
	FIBITMAP dib, 
	unsigned char% index_a, 
	unsigned char% index_b
)

Parameters

dib
Type: FreeImageAPI..::.FIBITMAP
Handle to a FreeImage bitmap.
index_a
Type: System..::.Byte %
One of the two palette indices to be swapped.
index_b
Type: System..::.Byte %
The other of the two palette indices to be swapped.

Return Value

The total number of pixels changed.

Remarks

This function swaps the two specified palette indices index_a and index_b on a palletized image. Therefore, not the palette, but the actual image data will be modified.

Note, that this behaviour is different from what SwapColors(FIBITMAP, RGBQUAD%, RGBQUAD%, Boolean) does on palletized images, which only swaps the colors in the palette.

This is just a thin wrapper for ApplyColorMapping(FIBITMAP, array<RGBQUAD>[]()[], array<RGBQUAD>[]()[], UInt32, Boolean, Boolean) and resolves to:

CopyC#
return ApplyPaletteIndexMapping(dib, index_a, index_b, 1, true);

Version Information

FreeImage.NET

Supported in: 3.11.0, 3.12.0, 3.13.0, 3.13.1

See Also