IronSoftware.System.Drawing
v2024.12.3
Ironsoftware.Drawing은 원래 Iron Software에서 개발 한 오픈 소스 라이브러리로 C# 소프트웨어 엔지니어가 .NET 프로젝트의 System.Drawing.Common을 대체 할 수 있도록 도와줍니다.
IronSoftware.Drawing.AnyBitmap 사이의 암시 적 캐스팅 및 인기있는 비트 맵/이미지 형식 지원 :| 암시 적 주조 지원 | 지원을받는 AnyBitmap 에 | AnyBitmap 에서 지원됩니다 |
|---|---|---|
System.Drawing.Bitmap | ✅ | ✅ |
System.Drawing.Image | ✅ | ✅ |
SkiaSharp.SKBitmap | ✅ | ✅ |
SkiaSharp.SKImage | ✅ | ✅ |
SixLabors.ImageSharp | ✅ | ✅ |
Microsoft.Maui.Graphics.Platform.PlatformImage | ✅ | ✅ |
IronSoftware.Drawing.Color 사이의 암시 적 캐스팅과 인기있는 색상 형식 지원 :| 암시 적 주조 지원 | 지지 된 Color | 지원 된 Color 에서 |
|---|---|---|
SkiaSharp.SKColor | ✅ | ✅ |
SixLabors.ImageSharp.Color | ✅ | ✅ |
SixLabors.ImageSharp.PixelFormats | ✅ | ✅ |
IronSoftware.Drawing.Rectangle 과 다음에 인기있는 사각형 형식 사이의 암시 적 주조 : 지원됩니다.| 암시 적 주조 지원 | 지원되는 Rectangle | Rectangle 에서 지원됩니다 | RectangleF 지원합니다 | RectangleF 에서 지원되었습니다 |
|---|---|---|---|---|
System.Drawing.Rectangle | ✅ | ✅ | ||
System.Drawing.RectangleF | ✅ | ✅ | ||
SkiaSharp.SKRect | ✅ | ✅ | ||
SkiaSharp.SKRectI | ✅ | ✅ | ||
SixLabors.ImageSharp.Rectangle | ✅ | ✅ | ||
SixLabors.ImageSharp.RectangleF | ✅ | ✅ |
IronSoftware.Drawing.Size 사이의 암시 적 주조와 지원되는 인기 크기 형식 :| 암시 적 주조 지원 | 지원되는 Size | 지원되는 Size 에서 | SizeF 에 지원됩니다 | SizeF 에서 지원됩니다 |
|---|---|---|---|---|
System.Drawing.Size | ✅ | ✅ | ||
System.Drawing.SizeF | ✅ | ✅ | ||
SkiaSharp.SKSize | ✅ | ✅ | ||
SkiaSharp.SKSizeI | ✅ | ✅ | ||
SixLabors.ImageSharp.Size | ✅ | ✅ | ||
SixLabors.ImageSharp.SizeF | ✅ | ✅ | ||
Microsoft.Maui.Graphics.Size | ✅ | ✅ | ||
Microsoft.Maui.Graphics.SizeF | ✅ | ✅ |
IronSoftware.Drawing.Font 사이의 암시 적 주조와 인기있는 글꼴 형식 지원 :| 암시 적 주조 지원 | Font 에 | Font 에서 지원되었습니다 |
|---|---|---|
System.Drawing.Font | ✅ | ✅ |
SkiaSharp.SKFont | ✅ | ✅ |
SixLabors.Fonts.Font | ✅ | ✅ |
IronSoftware.Drawing.Point 간의 암시 적 IronSoftware.Drawing.PointF 및 다음 지원 :| 암시 적 주조 지원 | Point 으로 | Point 에서 지원됩니다 | PointF 지원 | PointF 에서 지원되었습니다 |
|---|---|---|---|---|
System.Drawing.Point | ✅ | ✅ | ||
System.Drawing.PointF | ✅ | ✅ | ||
SixLabors.ImageSharp.Point | ✅ | ✅ | ||
SixLabors.ImageSharp.PointF | ✅ | ✅ | ||
Microsoft.Maui.Graphics.Point | ✅ | ✅ | ||
Microsoft.Maui.Graphics.PointF | ✅ | ✅ | ||
SkiaSharp.SKPoint | ✅ | ✅ | ||
SkiaSharp.SKPointI | ✅ | ✅ |
Ironsoftware 설치 Nuget 패키지를 빠르고 쉽게 쉽게 만들 수 있습니다. 이는 다음과 같은 패키지를 설치하십시오.
PM> Install-Package IronSoftware.System.Drawing
또는 공식 Nuget 웹 사이트에서 직접 다운로드하십시오.
설치되면 using IronSoftware.Drawing; C# 코드의 상단에.
AnyBitmap 코드 예제 using IronSoftware . Drawing ;
// Create a new AnyBitmap object
var bitmap = AnyBitmap . FromFile ( "FILE_PATH" ) ;
bitmap . SaveAs ( "result.jpg" ) ;
var bytes = bitmap . ExportBytes ( ) ;
var resultExport = new System . IO . MemoryStream ( ) ;
bitmap . ExportStream ( resultExport , AnyBitmap . ImageFormat . Jpeg , 100 ) ;
// Casting between System.Drawing.Bitmap and IronSoftware.Drawing.AnyBitmap
System . Drawing . Bitmap image = new System . Drawing . Bitmap ( "FILE_PATH" ) ;
IronSoftware . Drawing . AnyBitmap anyBitmap = image ;
anyBitmap . SaveAs ( "result-from-casting.png" ) ;
// Creates a Multi-page Tiff-style AnyBitmap from an Image array
List < AnyBitmap > bitmaps = new List < AnyBitmap > ( )
{
AnyBitmap . FromFile ( "FILE_PATH_1" ) ,
AnyBitmap . FromFile ( "FILE_PATH_2" )
} ;
AnyBitmap anyBitmap = AnyBitmap . CreateMultiFrameTiff ( bitmaps ) ;
// Creates a Multi-page Tiff-style AnyBitmap from a fully qualified file path array
List < string > imagePaths = new List < string > ( )
{
"FILE_PATH_1" ,
"FILE_PATH_2"
} ;
AnyBitmap anyBitmap = AnyBitmap . CreateMultiFrameTiff ( imagePaths ) ;
// Manipulate image frames
int frameCount = anyBitmap . FrameCount ;
List < AnyBitmap > frames = ( List < AnyBitmap > ) anyBitmap . GetAllFrames ;Color 코드 예제 using IronSoftware . Drawing ;
// Create a new Color object
Color fromHex = new Color ( "#191919" ) ;
Color fromRgb = new Color ( 255 , 255 , 0 ) ;
Color fromEnum = Color . Crimson ;
// Casting between System.Drawing.Color and IronSoftware.Drawing.Color
System . Drawing . Color drawingColor = System . Drawing . Color . Red ;
IronSoftware . Drawing . Color ironColor = drawingColor ;
ironColor . A ;
ironColor . R ;
ironColor . G ;
ironColor . B ;
// Luminance is a value from 0 (black) to 100 (white) where 50 is the perceptual "middle grey"
ironColor . GetLuminance ( ) ;
// Gets the 32-bit ARGB value of this Color structure.
ironColor . ToArgb ( ) ;Rectangle 코드 예제 using IronSoftware . Drawing ;
// Create a new Rectangle object
Rectangle rectangle = new Rectangle ( 5 , 5 , 50 , 50 ) ;
// Create a new Rectangle object with MeasurementUnits
Rectangle mmRectangle = new Rectangle ( 5 , 5 , 50 , 50 , MeasurementUnits . Millimeters ) ;
// Convert between MeasurementUnits
Rectangle pxRectangle = mmRectangle . ConvertTo ( MeasurementUnits . Millimeters ) ;
// Or specify DPI
Rectangle pxRectangleWithDPI = mmRectangle . ConvertTo ( MeasurementUnits . Millimeters , 200 ) ;
// Casting between System.Drawing.Rectangle and IronSoftware.Drawing.Rectangle
System . Drawing . Rectangle rectangle = new System . Drawing . Rectangle ( 10 , 10 , 150 , 150 ) ;
IronSoftware . Drawing . Rectangle ironRectangle = rectangle ;
ironRectangle . X ;
ironRectangle . Y ;
ironRectangle . Width ;
ironRectangle . Height ;Size 코드 예제 using IronSoftware . Drawing ;
// Create a new Size object
Size size = new Size ( 50 , 50 ) ;
// Casting between System.Drawing.Size and IronSoftware.Drawing.Size
System . Drawing . Size systemSize = new System . Drawing . Size ( 150 , 150 ) ;
IronSoftware . Drawing . Size ironSize = systemSize ;
ironSize . Width ;
ironSize . Height ;Font 코드 예제 using IronSoftware . Drawing ;
// Create a new Font object
Font font = new Font ( "Times New Roman" , FontStyle . Italic | FontStyle . Bold , 30 ) ;
// Casting between System.Drawing.Font and IronSoftware.Drawing.Font
System . Drawing . Font drawingFont = new System . Drawing . Font ( "Courier New" , 30 ) ;
IronSoftware . Drawing . Font ironFont = drawingFont ;
ironFont . FamilyName ;
ironFont . Style ;
ironFont . Size ;
ironFont . Italic ;
ironFont . Bold ; Iron Software에 대한 자세한 내용은 당사 웹 사이트를 방문하십시오 : https://ironsoftware.com/
일반적인 지원 및 기술 문의는 다음과 같이 이메일을 보내주십시오 : [email protected]