Number of 10 ways to improve the performance of WPF applications

Source: Internet
Author: User

Number of 10 ways to improve WPF application performance November 16, 2010 00:05 it168 website Original author: IT168 Huangyongbing Edit: Huminya Comments: 0 article Tag:ASP.NET WPF. NET

"IT168" WPF (Windows presentation Foundation) applications running slowly on a machine without a graphics accelerator is an open secret, giving the user the impression that it is eating too much, and that the performance and hardware of the WPF program really has a lot to do with it. The more upscale the machine performance the more advantages.

Program performance improvements are not done overnight, and good design eliminates problems that affect performance, for example, building objects at run time can have an impact on program performance. Although WPF provides a richer user interface with features such as enhanced navigation, but you should consider whether your users really need a rich graphical interface, although WPF has such a problem, but it does give developers a lot of flexibility in UI design, especially custom styling and control templates.



Figure 1 WPF schema, Blue is a Windows component, and Brown is a WPF component

The main factor in rendering a WPF program is the amount of pixels it contains, and WPF uses Microsoft's DirectX to render the program's running hardware, so if your machine has a stand-alone video card, running the WPF program will be smoother. In addition to improving the hardware configuration, let's look at 10 soft ways to improve the performance of WPF programs.

 1, reduce bitmapscalingmode, accelerate image rendering

When you include animations in your WPF program, you can use the Bitmapscalingmode property of the Renderoptions object to reduce resource consumption, and you need to set the value of the Bitmapscalingmode property to Lowquality. This will use the acceleration algorithm to process the image instead of the default high quality image resampling algorithm. The following code fragment shows the most basic implementation methods:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.