EdgeMode Performance

In addition, the performance can be further enhanced if it freeze (Freeze). In most cases it makes sense, because We object maps are not intended to modify. private static Geometry objects of different types: houses, rivers, roads and so on. Their number in the hundreds. Unfortunately, the simplest solution that comes to mind in this case, namely the use of one hand the object to one kind of object causes a significant slowdown of the system. And we again had to find an optimal way of creating brushes and pens to improve performance. Creating a new brush just before use also has not led to significant improvement in performance.

Maximum effect was achieved using some brush or pen as a template and getting out of them using the GetCurrentValueAsFrozen () copies for appendix, we signed objects against the background of a translucent rectangle. Its size depends on the size of the text. However, the logical decision to use the width and height of the object FormattedText to draw a rectangle and then draw text above it is not optimal. Recalculation occurs repeatedly. To avoid this, one must first perform text rendering, drawing a rectangle, then add the obtained DrawingVisual objects in the collection of visual objects in the correct order. Peremeschinie map with your mouse is a fairly simple task and in fact is the correct calculation of the parameters for the class TranslateTransform performing shift objects. You can use the transforming a number of fairly sophisticated effects, such as changing the viewing angle, the rotation of maps and stuff, but the performance is poor.

Also found a very strong fall in drawing the lines. This is a serious problem, because absolutely necessary to perform rendering of map objects such as roads, rivers, county boundaries and so on. Finding a solution to this poblemy not been an some success, only found a way to somehow speed up the rendering was a recommendation to use only whole numbers to specify the thickness of the pen. Another unknown fact is that if you disable antialisinga greatly reduced. RenderOptions.SetEdgeMode (this, EdgeMode.Aliased); I hope there are readers who will be able to explain this behavior, as well as ways to improve . When creating a wpf application useful free tools for performance profiling, such as wpf Perforator 7, and also to familiarize with the recommendations of Micrsoft, which can be found on msdn. Checking the hit-hit-testing (Hit testing) in the case described Suggested wpf animation features, layout, hit test, and other fairly complex things are now sold in just a few lines. Using wpf justified, if not required to perform rendering thousands visual objects and allows for a rather interesting effects. When drawing a fairly large number of complex objects, and especially the lines, it is necessary to think seriously on issues of productivity. It seems possible to use wpf if the computers on which you want to use the application to be powerful and worth thinking about other alternatives if the computers will be weak. For example, our application impossible to work on the computer Celeron 2000 with GeForce 4 MX400 and 1GB, although it is quite possible to play computer games such as Counter Strike.

Author: Jackie