This gist repository is a collection of C# code samples from the SVG Filters and SVG Gradients sections of the Aspose.SVG for .NET documentation. These practical snippets demonstrate how to apply visual effects based on SVG filters, color transforms, and gradient fills when creating SVG content programmatically.
- Gaussian Blur and Drop Shadows – Apply soft blur and drop shadow effects with
<feGaussianBlur>,<feDropShadow>,<feOffset>,<feBlend>, and more. - Color Matrix and Channel Manipulation – Use
<feComponentTransfer>and<feColorMatrix>to adjust RGBA channels or apply hue and saturation filters. - Lighting Effects – Create specular lighting highlights with
<feSpecularLighting>and point lights. - SVG Gradients – Create linear and radial gradients with multiple color stops to create rich, scalable designs.
- API Fluent Builder – Streamline the creation of filters and gradients with the
SVGSVGElementBuilderfrom SVG Builder API for fluent and expressive code.
Each example serves as a standalone executable demonstration designed to help you quickly understand and implement SVG functionalities in your .NET applications.
- Create a .NET C# project and install the Aspose.SVG for .NET library via NuGet.
- Locate the example that matches your specific task.
- Copy the C# code directly from the example. Adjust the file paths, input parameters, and output parameters as needed.
- Run the code to experience the capabilities of SVG filters and gradients.
Aspose.SVG for .NET is a powerful API for working with SVG files in C# applications. It allows developers to create, load, edit, and convert SVG documents without using external software. With full support for filters, gradients, transformations, conversions, and DOM manipulation, the library simplifies the integration of complex vector graphics into .NET solutions. Aspose.SVG offers high-quality rendering, automates graphics processes, and provides seamless integration into modern development environments.
- .NET Platforms: .NET Framework 4.6.1+, .NET Core 2.0+, or .NET 5+.
- Supported OS: Windows, Linux, macOS.
- Aspose.SVG for .NET installed via NuGet.