# ColourExtensionMethods.ToBitmap examples

Examples for [ToBitmap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/tobitmap.md) in Grasshopper2.Extensions.ColourExtensionMethods.

## C#

```cs
using Grasshopper2.Extensions;

// As an extension method
Bitmap result = color.ToBitmap(width, height);

// As a static method
result = ColourExtensionMethods.ToBitmap(color, width, height);
```

## Python

```python
import clr
clr.AddReference('Grasshopper2')
import Grasshopper2.Extensions
clr.ImportExtensions(Grasshopper2.Extensions)

# As an extension method
result = color.ToBitmap(width, height)

# As a static method
result = Grasshopper2.Extensions.ColourExtensionMethods.ToBitmap(color, width, height)
```
