System.Drawing.Common 9.0.0-preview.2.24128.3
System.Drawing.Common
The System.Drawing.Common
package allows .NET Core and .NET 6+ applications to access GDI+ graphics functionality.
This package is especially useful for porting .NET Framework applications that rely on the System.Drawing
namespace.
Getting Started
To get started with System.Drawing.Common
, install it using the NuGet Package Manager, the .NET CLI, or by editing your project file directly.
NOTE: If you are developing a WinForms application, you do not need to install the System.Drawing.Common
package separately (to this end, you use the Sdk
attribute for the Project
element like <Project Sdk="Microsoft.NET.Sdk">
in the .csproj or the .vbproj file and then specify <UseWindowsForms>true</UseWindowsForms>
). This package is then automatically included as part of the .NET SDK for WinForms Apps, which means you can start using the System.Drawing
namespace right away in your WinForms projects.
Usage
The following examples demonstrate some basic tasks you can accomplish with System.Drawing.Common
.
Create a Simple Bitmap and Save it
C#
using System.Drawing;
class Program
{
static void Main()
{
using (Bitmap bitmap = new Bitmap(100, 100))
{
using (Graphics g = Graphics.FromImage(bitmap))
{
g.Clear(Color.Red);
}
bitmap.Save("output.bmp");
}
}
}
VB
Imports System.Drawing
Module Program
Sub Main()
Using bitmap As New Bitmap(100, 100)
Using g As Graphics = Graphics.FromImage(bitmap)
g.Clear(Color.Red)
End Using
bitmap.Save("output.bmp")
End Using
End Sub
End Module
Additional Documentation
For more in-depth tutorials and API references, you can check the following resources:
- NuGet Gallery | System.Drawing.Common
- System.Drawing.Common Namespace | Microsoft Docs
- Drawing with System.Drawing.Common | Microsoft Learn
Feedback
- Open an issue on the GitHub repository
- Reach out on Twitter with the hashtag #winforms
- Join our Discord channel: dotnet/Discord
Showing the top 20 packages that depend on System.Drawing.Common.
Packages | Downloads |
---|---|
Aspose.Cells
A powerful and fast library written in C# for manipulating and converting Excel(XLS, XLSX,XLSB), ODS, CSV,JSON and HTML files.
|
59 |
Aspose.Cells
A powerful and fast library written in C# for manipulating and converting Excel(XLS, XLSX,XLSB), ODS, CSV,JSON and HTML files.
|
195 |
FastReport.Compat
Common compatible types for FastReport.Net
|
6,007 |
FastReport.Core
FastReport.Core is a full-featured reporting solution for .Net Core and .Net Framework 4.x.
Various report objects will allow your report to look exactly how you want it to: 13 types of bands, 25 types of barcodes, table object, diagram, maps, shapes, line, PolyLine, Polygon and many more.
FastReport.Core supports export to various popular formats, such as PDF/A, Excel, Word, Open Office, HTML, CSV, Json, XAML, ZPL, etc.
|
3,881 |
FastReport.DataVisualization
Charting library
|
6,023 |
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.
When using NuGet 3.x this package requires at least version 3.4.
|
696 |
Quantum.Framework.Core.StandardLib
Package Description
|
55 |
Quantum.Framework.Core.StandardLib
Package Description
|
57 |
Quantum.Framework.Core.StandardLib
Package Description
|
58 |
Quantum.Framework.Core.StandardLib
Package Description
|
62 |
Quantum.Framework.Core.StandardLib
Package Description
|
64 |
Quantum.Framework.Core.StandardLib
Package Description
|
74 |
Quantum.Framework.Core.StandardLib
Package Description
|
77 |
Quantum.Framework.Core.StandardLib
Package Description
|
114 |
Quantum.Framework.Core.StandardLib
Package Description
|
153 |
Quantum.Framework.Core.StandardLib
Package Description
|
159 |
Quantum.Framework.Core.StandardLib
Package Description
|
167 |
SoapCore
SOAP protocol middleware for ASP.NET Core
|
94 |
ThoughtWorks.QRCode.Standard
二维码识别生成类库ThoughtWorks.QRCode标准版
ThoughtWorks.QRCode很好用,但是该类库不支持标准库
于是我通过反编译dll,做了个标准版,并依赖引用了System.Drawing.Common
另外我发现当解析数据过长,或者QRCodeVersion>=30时,会抛出异常,
这个我做了修复,使用自动QRCodeVersion,也就是这个属性无需赋值,可以参考readme里面的使用示例
作者haoersheng没有留联系方式,如有侵权请联系我删除!!!
|
1,684 |
.NET Framework 4.6.2
- No dependencies.
.NET 8.0
- Microsoft.Win32.SystemEvents (>= 9.0.0-preview.2.24128.5)
.NET 9.0
- Microsoft.Win32.SystemEvents (>= 9.0.0-preview.2.24128.5)
.NET Standard 2.0
- No dependencies.