Look at SwapChannels for details.
function ImSwapChannels(var Image: TImageData; SrcChannel: LongInt; DstChannel: LongInt): Boolean; cdecl;
ImagingExport (at line 117)