VG.net 5.1 Released
Version 5.1 of the VG.net vector graphics system is released. Click the image above to run the robot arm sample. The buttons at the top change the overall color of the application. This color change uses a new feature in VG.net called Themes.
A Theme is similar to a style sheet in html. A Theme collects common Style and ImageData objects in a single place, for reuse across multiple Pictures, or to swap a set of Styles as a batch. The robot arm sample contains three Themes that are dynamically swapped to change several Styles at the same time. When used across multiple Pictures, a Theme eliminates time wasted duplicating and synchronizing Styles. You can edit and preview Styles in a Theme as you would in any Picture.
Other changes in version 5.1 include:
- Fast Scrolling: by default, Canvas scrolling is hardware accelerated, as demonstrated in an earlier blog post.
- Serialization: save and restore objects to and from compact binary files or streams. You can serialize VG.net objects or your own classes and structures. This is useful for custom editors, storing objects in a database, or transferring objects across a network. You will find serialization related classes in the Prodige.Serialization namespace. Unlike the serialization support built into the .NET framework, the classes in Prodige.Serialization are designed to: minimize file size, maximize speed, operate without reflection or boxing of value types, and provide infinite upward compatiblity for serialized files.
- TranslucentForm Improvements: the TranslucentForm class, a window providing a complete vector graphics UI with per-pixel alpha transparency, is extensively reworked and many problems are eliminated.
- Source Code Samples: new samples in the standard and Extras package include a strip chart library, a SCADA simulation, a particle system, a Theme demonstration, a basic button library, and bitmap effects. Two of the these samples are described below.
- The VG.net Users Guide contains new sections describing Themes and Serialization.
- Bug fixes and smaller enhancements: please see the 5.1 Readme for more information.
A new strip chart component is provided in the strip chart sample in the Extras package. Click on the image above to run the sample. The strip chart is designed to minimize CPU usage, so you can use several on the same screen. You can pause the automatic chart scrolling. When paused, you can manually scroll the chart to any data sample. The chart saves data samples in a circular buffer, which you can set to any size needed. The chart also supports zooming in integer increments.
Click the image above or below to run the new particle system sample provided in the Extras package. The particle system creates and animates 10,000 particles. Originally written to illustrate the operation of an egg smashing machine, you may wish to use the particle system component to illustrate a mixing or painting operation. The particle system performs all rendering with managed code.