- Visualization object
Visual class: If you want to build a program for drawing vector graphics, you can plan to create a canvas that contains thousands of shapes and can operate on these shapes separately, the element systems and shape classes that use WPF cannot meet the requirements. Instead, they must use lower-level visual classes with a higher level to manually perform rendering. Because the visual class is an abstract class and cannot create instances of this class, you need to use the derived class of the visual class. The most useful derived class is the drawingvisual class, which provides the ability to "Draw" the graphic content that you want to place in a visual object.
To use the drawingvisual class to draw content, you need to call the renderopen () method, which returns a drawingcontext object used to define the visible content. After the painting is complete, you need to call the close () method, the following is the complete process of drawing a graph:
Drawingvisual = new drawingvisual ();
Drawingcontext Dc = drawingvisual. renderopen ();
// Perform Drawing here.
DC. Close ();
Essentially, the drawingcontext class is composed of various methods that add some graphical details to a visual object. You can call these methods to draw various graphics, apply transformations, and change opacity, and list the methods of the drawingcontext class:
13. Effects and visualization objects