WPF: Performance Adjustment

Source: Internet
Author: User
  1. 2d graphics and Imaging
    1. Use drawing instead of shape as much as possible, because drawing does not support layout and event
    2. Use drawingvisual to draw backgrounds and other places that do not require layout or event.
    3. Decode to the minimum size when using a graphic
    4. During animation, call renderoptions. setbitmapscalingmode () to set the image to lowquality.
    5. Cache brush.
      // Set the minimum and maximum relative sizes for regenerating the tiled brush. renderoptions. setcacheinvalidationthresholdminimum (drawingbrush, 0.5); renderoptions. setcacheinvalidationthresholdmaximum (drawingbrush, 2.0); // The tiled brush will be regenerated when the size is // 0.5x, 0.25x (and so forth) // and // 2x, 4x, 8x (and so forth) // of the original size. // set the caching hint option for the brush. renderoptions. setcachinghint (drawingbrush, cachinghint. cache );

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.