A Shape inherits from FrameworkElement and, therefore, is a high-level object that provides features such as hit-testing, styling, layout and data binding. In contrast, Drawing does not inherit from FrameworkElemet and does not support any of these functions. Since the documentation mentions that Drawing is useful for light visual objects. If you create a complex brush to paint areas or backgrounds, DrawingBrush will be very effective.
Drawings can combine text, video, images and Geometry objects (another light weight) to create complex, but very effective and fast drawings,
In short, a Drawing is an alternative to Shape at a low level. As for use cases, it depends.
- If you need to animate or make any bindings, you should use Shapes.
- If you are creating brushes or complex graphics / vector graphics, you are likely to use drawings.
- Also, if you draw things by overriding
OnRender , you mostly use Geometries.
A Drawing also Freezable and therefore can be split between threads (provided that it is frozen).
Patrick klug
source share