Skip to content

Instantly share code, notes, and snippets.

@Mpdreamz
Created May 29, 2011 17:39
Show Gist options
  • Save Mpdreamz/997984 to your computer and use it in GitHub Desktop.
Save Mpdreamz/997984 to your computer and use it in GitHub Desktop.
WPF force software rendering
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
}
}
@borgeslt
Copy link

For .Net 3.5 SP1 you can use:

public partial class MyWindow : Window
{
    public MyWindow()
        : base()
    {
        InitializeComponent();
    }

    protected override void OnSourceInitialized(EventArgs e)
    {
        var hwndSource = PresentationSource.FromVisual(this) as HwndSource;

        if (hwndSource != null)
            hwndSource.CompositionTarget.RenderMode = RenderMode.SoftwareOnly;

        base.OnSourceInitialized(e);
    }
}

And also you can set it through the register

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment