---
title: "ChannelsProvider..::.SwapChannels Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_ChannelsProvider_SwapChannels_1_a56295c4.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# ChannelsProvider.SwapChannels Method 
 
Swaps channels.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub SwapChannels ( _channels As Integer() _
)
```
 
```csharp
public void SwapChannels(int[] channels
)
```
 
### Parameters
 
 - channels
     - Type:  [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d) []
An array of channel indices sorted in the necessary order. E.g. if you need to swap blue and green channel in RGB bitmap, this array will be looking in the following way: (1, 0, 2).
 
## Remarks
 If number of indices in *channels* argument is less than number of channels in the current bitmap, the rest channels will be unchanged. If there are more indices than current bitmap provides, all extra indices will be ignored.
 
## Examples
  
```
bitmap.Channels.SwapChannels(New Integer() {1, 0, 2})
```
 
```csharp
bitmap.Channels.SwapChannels(new int[] {1, 0, 2});
```
   
## See Also

### Reference

- [ChannelsProvider Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ChannelsProvider.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
