# .NET and More > WPF, WCF, WF >  [RESOLVED] [WPF] How can I set RenderOptions in code?

## boops boops

I'm able to get an (inherited) Canvas to render its content with NearestNeighbor scaling by using this XAML:



```
<my:ZCanvas x:Name="ZCanvas1" RenderOptions.BitmapScalingMode="NearestNeighbor">
```

I want to allow the user to select the rendering quality at run time, but I can't find a way to do it in code. There appears to be a SetRenderOptions method but I can't find how or where to apply it. Any suggestions?

BB

----------


## boops boops

Suddenly the penny dropped:


```
RenderOptions.SetBitmapScalingMode(Me, BitmapScalingMode.NearestNeighbor)
```

And all the time I assumed RenderOptions had to be a property of something :Blush: .  BB.

----------

