> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# TransformBrush()

## Definition

Scales a non-solid color brush used for rendering the chart style to properly display in NinjaTrader.

This method has no impact on solid color brushes.  You would only need to pass in either a linear or radial gradient brush.

## Method Return Value

This method does not return a value.

## Syntax

`TransformBrush(SharpDX.Direct2D1.Brush brush, RectangleF rect)`

## Method Parameters

| Parameter | Description                                                                                                                                                   |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| brush     | A [SharpDX.Direct2D1.Brush](/developer/desktop-sdk/references/sharpdx/sharpdx-direct2d1/sharpdx-direct2d1-brush) object representing the brush used to render |
| rect      | A [RectangleF](https://msdn.microsoft.com/en-us/library/system.drawing.rectanglef%28v=vs.110%29.aspx) structure representing the rectangle to be rendered     |

## Examples

```csharp
protected override void OnRender(ChartControl chartControl, ChartScale chartScale, ChartBars chartBars)
{
		TransformBrush(brush, rect);
}
```