Aspose.Drawing 24.12.0

dotnet add package Aspose.Drawing --version 24.12.0                
NuGet\Install-Package Aspose.Drawing -Version 24.12.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aspose.Drawing" Version="24.12.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Aspose.Drawing --version 24.12.0                
#r "nuget: Aspose.Drawing, 24.12.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Aspose.Drawing as a Cake Addin
#addin nuget:?package=Aspose.Drawing&version=24.12.0

// Install Aspose.Drawing as a Cake Tool
#tool nuget:?package=Aspose.Drawing&version=24.12.0                

Cross-Platform 2D Graphics Library for .NET

Version 24.12.0 Nuget .NET

banner


Docs API Ref Examples Blog Releases Support License


Aspose.Drawing vs. Aspose.Drawing.Common

Aspose.Drawing

  • A cross-platform 2D graphics library for .NET that serves as a direct replacement for System.Drawing.Common. It allows seamless migration without requiring any code changes.
  • If you're interested in seamless migration from System.Drawing.Common., use Aspose.Drawing.

Aspose.Drawing.Common

  • Uses the Aspose.Drawing namespace and allows side-by-side use with System.Drawing.Common. Ideal for projects that need a gradual migration while maintaining compatibility.
  • If you need side-by-side compatibility with System.Drawing.Common, use Aspose.Drawing.Common.

Aspose.Drawing for .NET is a high-performance, cross-platform 2D graphics API designed for .NET developers. It offers seamless migration from System.Drawing.Common and provides extensive drawing features for lines, shapes, arcs, polygons, and text. Supporting a wide range of platforms, including Windows, Linux, macOS, Azure, and Blazor WebAssembly, Aspose.Drawing ensures consistent rendering results without relying on third-party libraries. With its support for bitmap creation, vector graphics, transformations, text rendering, and anti-aliasing, it is ideal for developers seeking high-quality, multi-platform drawing capabilities in C#.

System.Drawing.Common Replacement

Cross-Platform Graphics Library

Aspose.Drawing for .NET provides a contemporary cross-platform graphic drawing library that offers advanced features and functionality.

Consistent Rendering

Ensures consistent rendering results across all supported platforms without the need for third-party libraries.

Extensive 2D Drawing Features

Supports drawing lines, shapes, splines, arcs, polygons, and text with anti-aliasing, strikeout, and underline rendering options.

High-Quality Rendering

Provides high-quality text rendering with anti-aliasing and hinting, making fonts look smooth on any display.

Cross-Platform 2D Graphics Library

Supported Platforms

Aspose.Drawing works across platforms such as Windows, macOS, Linux, Azure, and Blazor WebAssembly, ensuring consistent performance.

Installation via NuGet

Installable through the NuGet package manager for Visual Studio for easy integration.

Rendering Capabilities

Offers consistent results in rendering vector graphics and raster images across all platforms.

Cross-Platform Drawing API for C# (.NET)

Geometric Drawing API

Draw lines, shapes, rectangles, polygons, arcs, and Bezier curves with a cross-platform C# API.

Transformations Support

Apply different transformations to 2D objects and save results as raster or vector images.

Multi-Platform Consistency

Ensure consistent drawing quality across Windows, Linux, Azure, ASP.NET, and more.

Create Bitmap from Scratch or Load from File Using C#

New Bitmap Creation

Create a new image from scratch using Aspose.Drawing with support for drawing arcs, curves, and lines.

Load Existing Images

Load and edit images from file and save them back to disk using the API.

Drawing Tools

Utilize pens and brushes to create a variety of shapes and images.

Working with Vector Graphics in C#

Draw Arc

Draw arcs by specifying starting points, angles, and dimensions on a bitmap.

Draw Bezier Spline

Draw Bezier curves using control points to define the curve direction.

Draw Lines and Shapes

Create and manipulate lines, rectangles, ellipses, and polygons using the Graphics and Pen objects.

Working with Pens

Set Pen Width

Define the width of lines when drawing with pens.

Set Pen Color

Customize pen colors for drawing lines and shapes on a bitmap.

Join Lines

Join multiple lines to create complex paths and shapes.

Using Aspose.Drawing in .NET 6

Cross-Platform Support

Fully supports .NET 6 for cross-platform graphics rendering, with consistent performance across Windows, Linux, and macOS.

Azure Function Compatibility

Use Aspose.Drawing in serverless Azure Functions for graphics manipulation.

Blazor WebAssembly Integration

Integrates seamlessly with Blazor WebAssembly for client-side rendering and drawing.

Working with Brushes

Solid Brushes

Fill shapes with solid colors using the SolidBrush class.

Gradient Brushes

Use linear and path gradient brushes to create complex color patterns.

Texture Brushes

Apply textures to shapes for enhanced graphical effects.

Working with Image Rendering

Antialiasing for Images

Enable antialiasing to smooth edges and enhance image quality during rendering.

Clipping Path

Use the SetClip method to define clip paths for rendering parts of an image.

Alpha Blending

Blend images with backgrounds using alpha channels for transparency.

Working with Coordinate System Transformations

Global Transformation

Apply global transformations like rotation and translation to the entire graphic object.

Matrix Transformation

Use matrix transformations to rotate, scale, and skew individual shapes within an image.

Units of Measure

Customize units of measure (pixels, points, inches) for precise image rendering.

Working with Text and Fonts

Draw Text

Use the DrawString method to render text on images with different fonts and styles.

Text Formatting

Format text alignment, line spacing, and font properties for precise rendering.

Text Hinting

Apply text hinting to enhance readability and ensure smooth font edges.

Supported File Formats

Format Description Load Save
BMP Bitmap Image Format ✔️ ✔️
PNG Portable Network Graphics ✔️ ✔️
JPEG Joint Photographic Experts Group ✔️ ✔️
GIF Graphics Interchange Format ✔️ ✔️
TIFF Tagged Image File Format ✔️ ✔️

System Requirements

Operating Systems

Aspose.Drawing for .NET supports 32-bit and 64-bit systems, including:

  • Microsoft Windows (XP, Vista, 7, 8, 10) and Server (2003, 2008, 2012, 2016, 2019)
  • Windows Azure, Linux, Mac OS X

Supported Frameworks

  • .NET Framework 2.0
  • .NET Core 2.0 or later

Development Environments

  • Microsoft Visual Studio 2012, 2013, 2015, 2017, 2019

Get Started

1. Install via NuGet

  • Open Microsoft Visual Studio and the NuGet package manager.
  • Search for Aspose.Drawing.
  • Click Install to download and reference it in your project.

2. Install or Update via Package Manager Console

  • Open Visual Studio and go to Tools > Library Package Manager > Package Manager Console.
  • Type Install-Package Aspose.Drawing to install the latest version.
  • To update, use Update-Package Aspose.Drawing. You can add -prerelease to get hotfixes.

3. Referencing the Library

  • In Solution Explorer, right-click References and select Add Reference.
  • If manually installed, browse for Aspose.Drawing.dll and click OK to add it.

4. Uninstalling Aspose.Drawing

  • Open Control Panel > Add/Remove Programs.
  • Select Aspose.Drawing for .NET and click Remove to uninstall.

Draw an Arc in C#

This example shows how to create a bitmap, draw an arc, and save the image in C# using Aspose.Drawing for .NET.

// Create a bitmap object
using (var bitmap = new Bitmap(1000, 800))
{
    // Initialize a Graphics object with the bitmap
    using (var graphics = Graphics.FromImage(bitmap))
    {
        // Define a pen with color and width
        using (var pen = new Pen(Color.Blue, 2))
        {
            // Draw an arc on the bitmap
            graphics.DrawArc(pen, new Rectangle(0, 0, 700, 700), 0, 180);

            // Save the image as PNG
            bitmap.Save("output_arc.png");
        }
    }
}

Draw Text with Anti-Aliasing in C#

Demonstrates how to render anti-aliased text inside a clipped ellipse area using Aspose.Drawing for .NET.

// Create a bitmap object
using (var bitmap = new Bitmap(1000, 800))
{
    // Initialize a Graphics object with anti-aliasing
    using (var graphics = Graphics.FromImage(bitmap))
    {
        graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;

        // Create a GraphicsPath representing an ellipse
        var path = new GraphicsPath();
        path.AddEllipse(new Rectangle(200, 200, 400, 200));

        // Clip the text inside the ellipse
        graphics.SetClip(path);

        // Define font, brush, and format for the text
        var font = new Font("Arial", 20);
        var brush = new SolidBrush(Color.Black);
        var format = new StringFormat { Alignment = StringAlignment.Center };

        // Draw the string within the clipped ellipse
        graphics.DrawString("Hello World!", font, brush, new RectangleF(200, 200, 400, 200), format);

        // Save the image
        bitmap.Save("output_text.png");
    }
}

Create a Bezier Spline in C#

This snippet demonstrates drawing a Bezier spline using the DrawBezier method in Aspose.Drawing for .NET.

// Create a bitmap object
using (var bitmap = new Bitmap(1000, 800))
{
    // Initialize a Graphics object
    using (var graphics = Graphics.FromImage(bitmap))
    {
        // Define a pen for drawing
        using (var pen = new Pen(Color.Blue, 2))
        {
            // Define control points for Bezier curve
            Point pt1 = new Point(100, 100);
            Point pt2 = new Point(200, 10);
            Point pt3 = new Point(350, 400);
            Point pt4 = new Point(500, 300);

            // Draw the Bezier curve
            graphics.DrawBezier(pen, pt1, pt2, pt3, pt4);

            // Save the image
            bitmap.Save("output_bezier.png");
        }
    }
}

Docs API Ref Examples Blog Releases Support License


Tags

Cross-Platform 2D Graphics Library | System.Drawing.Common Replacement | Cross-Platform Drawing API | Geometric Drawing API | 2D Drawing in C# | Create Bitmap in C# | Aspose.Drawing for .NET | Working with Vector Graphics | Using Pens in C# | Drawing with Brushes | Image Rendering | Coordinate System Transformations | Text and Fonts in C# | Aspose.Drawing in .NET 6 | Aspose.Drawing in Azure | Blazor WebAssembly | Bitmap Image Creation | Rendering Vector Graphics | NuGet Package | Graphics API for .NET | Pen and Brush Usage | Text Rendering in C# | Drawing Arc in C# | Bezier Spline in C# | Text with Anti-Aliasing | Image Rendering with Clipping | Create Bitmap from Scratch | High-Quality Text Rendering | Azure Function Compatibility

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net20 is compatible.  net35 was computed.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 2.0

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (11)

Showing the top 5 NuGet packages that depend on Aspose.Drawing:

Package Downloads
Aspose.Tasks

Aspose.Tasks for .NET is a collection of classes that seamlessly integrates with your .NET applications to provide interaction and manipulation capabilities for the Microsoft ProjectⓇ file formats (MPP, MPT, MPX) as well as PrimaveraⓇ formats (XER, P6XML). Aspose.Tasks for .NET helps developers to create project management Apps in .NET that can work with Microsoft ProjectⓇ formulas, project calendars, calendar exceptions, tasks, task links, task baselines, resources, resource assignments, currencies, as well as fetching VBA information from an MPP file. You can also convert MS ProjectⓇ files to PDF, JPEG, Excel, SVG, HTML, CSV, BMP and many other formats. Aspose.Tasks for .NET supports any 32-bit or 64-bit OS where .NET or Mono framework is installed, including MS Windows, Linux, and macOS. Aspose.Tasks for .NET classes are packaged into a single DLL which removes your App dependency for any additional 3rd party components or software to be installed in order to work with the Microsoft ProjectⓇ or PrimaveraⓇ files.

Aspose.PSD

Aspose.PSD for .NET provides extensive manipulation capabilities for PSD and PSB file formats without requiring Adobe Photoshop and entry-level export capabilities for AI files without requiring Adobe Illustrator. It supports export to the following formats: Png, Jpeg, Jpeg2000, Gif, Bmp, Tiff, PSD, and PSB along with export to Pdf with selectable text. Aspose.PSD partially supports Adjustment Layers, Smart Objects, Text Layer, Fill Layers, Shape Layers, Group Layers, Layers Effects, and Editing of Raster and Vector Masks for layers. New features are added every month, keeping backward compatibility as one of the product’s priorities.

GroupDocs.Merger

GroupDocs.Merger for .NET allows you to merge documents and manipulate document structure across most of famous document types. Merge several documents into one, split single document to multiple documents, reorder or replace document pages, change page orientation and perform other manipulations with GroupDocs.Merger for .NET API. For more details on the GroupDocs.Merger for .NET API, please visit product website at: https://products.groupdocs.com/merger/net

Aspose.Total

Aspose.Total for .NET is the most complete package of all .NET file format APIs offered by Aspose. It empowers developers to create, edit, render, print and convert between a wide range of popular document formats within any .NET, C#, ASP.NET and VB.NET applications.

GroupDocs.Conversion.CrossPlatform

This is a cross-platform version of GroupDocs.Conversion for .NET. GroupDocs.Conversion for .NET is a powerful and intuitive library used for documents conversion. Convert DOC to PDF, PDF to DOC, XLS to DOC, PPT to PDF and any other popular file formats with simple, intuitive and flexible API. For more details on the GroupDocs.Conversion for .NET API, please visit product website at: https://products.groupdocs.com/conversion/net Note: The library will run in evaluation mode. In order to test full features of the product, please request a free 30-day temporary license.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
24.12.0 989 12/9/2024
24.11.0 5,236 11/11/2024
24.10.0 8,590 10/10/2024
24.9.0 6,974 9/6/2024
24.8.0 5,343 8/10/2024
24.7.0 3,442 7/12/2024
24.6.0 7,664 6/18/2024
24.5.0 9,653 5/9/2024
24.4.0 11,799 4/10/2024
24.3.0 12,417 3/8/2024
24.2.0 9,929 2/10/2024
24.1.0 21,720 1/10/2024
23.12.0 26,204 12/10/2023
23.11.0 10,312 11/9/2023
23.10.0 3,963 10/9/2023
23.9.0 4,862 9/8/2023
23.8.1 5,999 8/10/2023
23.7.0 24,456 7/7/2023
23.6.0 10,098 6/9/2023
23.5.0 124,411 5/5/2023
23.4.0 6,681 4/7/2023
23.3.0 7,234 3/14/2023
23.2.0 6,683 2/20/2023
23.1.0 14,990 1/27/2023
22.12.0 44,452 12/29/2022
22.11.0 7,587 11/29/2022
22.10.0 21,135 10/18/2022
22.9.0 17,480 9/27/2022
22.8.0 17,427 8/22/2022
22.7.0 5,973 7/14/2022
22.6.0 10,165 6/17/2022
22.5.0 7,324 5/20/2022
22.4.0 10,265 4/22/2022
22.3.0 13,347 3/24/2022
22.2.0 7,323 2/18/2022
22.1.0 5,938 1/28/2022
21.12.0 16,176 12/30/2021
21.11.0 8,954 11/20/2021
21.10.0 6,658 10/15/2021
21.9.0 10,429 9/16/2021
21.8.0 10,564 8/17/2021
21.7.0 8,382 7/16/2021
21.6.0 7,286 6/18/2021
21.5.0 9,664 5/18/2021
21.4.0 9,414 4/26/2021
21.3.0 6,703 3/26/2021
21.2.0 12,003 2/26/2021
21.1.0 2,792 2/1/2021
20.12.0 2,367 12/29/2020
20.11.0 7,167 11/30/2020
20.10.0 6,493 10/27/2020
20.9.0 2,354 10/1/2020
20.8.0 1,534 8/26/2020
20.7.0 3,228 7/22/2020
20.6.1 2,040 6/24/2020
20.6.0 1,530 6/24/2020