![]() ![]() If the image is larger than the max size for the control, the control is set to max size and the image is scaled.įor None and ContentToSizeNoStretch, the Horizontal/VerticalContentAlignment properties can be used to position the image within the control. SizeToContent: The control will be resized to fit the un-scaled image.ContentToSizeStretch: The image will be stretched to fill the entire width and height.Either X or Y direction will be scaled to fill the entire width or height. ContentToSizeNoStretch: The image is scaled to fit the control without any stretching.The image location is translated so the top left corner of the image bounding box is moved to the top left corner of the image control. ![]() SizeType - controls how the image is stretched to fill the control.The control only has a couple of properties, SizeType and ImageSource. The image control can either load the image from a filename - SetImage(filename) - or by setting the Drawing object through SetImage(Drawing), which allows multiple controls to share the same drawing instance. SVGRender is the class that creates the WPF Drawing object based on the information from the SVG class.The SVG class is the class that reads and parses the XML file.However, I soon realized that SVG is a very complex format, and at the same time, I found no good reason for converting to XAML just to show the image on the screen, so instead, I started working on the SVG, SVGRender and the SVGImage classes. I looked at some simple SVG files and noticed the similarity to XAML defined graphic, and decided to write a converter. This little project started out as a simple SVG to XAML converter. SVG (Scalable Vector Graphic) is an XML based graphic format. Download source code version 1.4 - 187 KB.Download source code version 1.3 - 181 KB. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |