This GitHub gist repository contains C# code examples used in the Aspose.HTML for .NET documentation, specifically within the SVG Transformations – Rotate, Scale, and Translate SVG chapter. These examples help developers apply SVG transformations such as rotation, scaling, translation, and matrix operations to programmatically manipulate vector graphics.
- Rotate Elements & Shapes – Rotate SVG shapes using the
rotate()function in thetransformattribute, the transformation matrix, or the SVG Builder API for easy and powerful manipulation. - Scale SVG Content – Apply
scale()transformations to entire documents or individual elements to change size. - Translate Elements – Move shapes by applying the
translate()function in thetransformattribute and via the transformation matrix. - Transformation Matrices – Work directly with SVG matrices, modify and apply transformations via matrix string attributes.
- SVG Builder API for Transformations – Use the
SVGSVGElementBuilderorSVGRectElementBuilderhelpers to apply transformations in expressive, chainable code patterns.
- Make sure you have the Aspose.SVG for .NET library installed.
- Find and copy the gist that corresponds to your specific task.
- Open and adjust the example files with your paths and file names.
- Run the code to transform SVG and inspect the output SVG files – watch how transformations are applied visually and programmatically.
Aspose.SVG for .NET is a robust, cross-platform library enabling full control over SVG graphics in C# applications. It provides an API for creating, editing, saving, and converting SVG content without requiring external software. With features such as DOM manipulation, SVG Builder, and transformation matrices, it enables developers to automate complex vector graphics processes related to rotation, scaling, translation, and skew on Windows, Linux, and macOS.
To run the examples, you need:
- .NET Platforms: .NET Platforms: .NET 5.0+, .NET Framework 4.6.1+, or .NET Core 2.0+
- Supported OS: Windows, Linux, macOS
- The Aspose.SVG for .NET library (you can install it via NuGet:
Install-Package Aspose.SVG).