Find out how wpf is being rendered

WPF applications can render in three modes: everything in software, partial hardware rendering or full hardware rendering. The rendering mode may have a big effect to the application performance. This it is important to know which mode is active:

           Console.WriteLine("WPF Rendering " + GetStringForRenderCapabilityTier(RenderCapability.Tier));
            RenderCapability.TierChanged +=
                (sender, args) => Console.WriteLine("WPF Rendering changed to " + GetStringForRenderCapabilityTier(RenderCapability.Tier));


        private string GetStringForRenderCapabilityTier(int tier) {
            switch (tier / 0x10000) {
                case 0:
                    return "Software Rendering";
                case 1:
                    return "Hardware Rendering (partial)";
                case 2:
                    return "Hardware Rendering (full)";
                default:
                    return "Unknown Rendering Mode: " + tier;
            }
        }

Leave a comment

Your email address will not be published. Required fields are marked *