|
Posted on
2009-09-23 12:51
mrfangzheng
阅读( 437)
评论()
编辑
收藏
举报
- 2D Graphics and Imaging
- 尽量使用Drawing来代替Shape. 因为Drawing不用支持Layout和Event
- 尽量使用DrawingVisual来绘制背景等不需要Layout和Event的地方
- 使用图形时, 尽量decode到最小的size
- 在动画时, 调用RenderOptions.SetBitmapScalingMode()把图片设置到LowQuality
- 缓存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);
|