FrameworkExtensions.System.Drawing
1.0.0.49
See the version list below for details.
dotnet add package FrameworkExtensions.System.Drawing --version 1.0.0.49
NuGet\Install-Package FrameworkExtensions.System.Drawing -Version 1.0.0.49
<PackageReference Include="FrameworkExtensions.System.Drawing" Version="1.0.0.49" />
<PackageVersion Include="FrameworkExtensions.System.Drawing" Version="1.0.0.49" />
<PackageReference Include="FrameworkExtensions.System.Drawing" />
paket add FrameworkExtensions.System.Drawing --version 1.0.0.49
#r "nuget: FrameworkExtensions.System.Drawing, 1.0.0.49"
#:package FrameworkExtensions.System.Drawing@1.0.0.49
#addin nuget:?package=FrameworkExtensions.System.Drawing&version=1.0.0.49
#tool nuget:?package=FrameworkExtensions.System.Drawing&version=1.0.0.49
Extensions to System.Drawing
Extension methods for System.Drawing types (bitmaps, images, colors, graphics).
Extension Methods
Bitmap Extensions (Bitmap)
Bitmap Locking
Lock(...)- Lock bitmap for direct pixel access (8 overloads for different combinations)Lock()- Lock entire bitmap with ReadWrite modeLock(Rectangle)- Lock regionLock(ImageLockMode)- Lock with specific modeLock(PixelFormat)- Lock with specific formatLock(Rectangle, ImageLockMode)Lock(Rectangle, PixelFormat)Lock(ImageLockMode, PixelFormat)Lock(Rectangle, ImageLockMode, PixelFormat)- Full control- Returns format-specific
IBitmapLockerimplementation
Transformations
ConvertPixelFormat(PixelFormat)- Convert bitmap to different pixel formatCrop(Rectangle, PixelFormat = DontCare)- Extract region from bitmapResize(int width, int height, InterpolationMode = Bicubic)- Resize bitmapRotated(float angle, Point? center = null)- Create rotated copy of bitmapRotateInplace(float angle, Point? center = null)- Rotate bitmap in-placeRotateTo(Bitmap target, float angle, Point? center = null)- Rotate to target bitmap
Image Extensions (Image)
Multi-Page Support
GetPageAt(int page)- Get specific page from multi-page image (e.g., TIFF)GetPageCount()- Get total number of pages in image
Save Operations
SaveToPng(FileInfo/string)- Save image as PNGSaveToTiff(string)- Save image as TIFFSaveToJpeg(string/Stream, double quality = 1)- Save as JPEG with quality (0.0-1.0)
Conversions
ToIcon(int targetRes = 0)- Convert image to IconToBase64DataUri()- Convert to Base64 data URI stringFromBase64DataUri(string)(static-like extension on string) - Create image from Base64 data URI
Image Processing
MakeGrayscale()- Convert image to grayscaleThreshold(byte threshold = 127)- Apply threshold filter (black/white)ApplyPixelProcessor(Func<Color, Color> processor)- Apply custom pixel transformation functionMirrorAlongX()- Mirror horizontallyMirrorAlongY()- Mirror verticallyResize(int longSide)- Resize to fit within square, keep aspectResize(int longSide, Color fillColor)- Resize with fill colorResize(int width, int height, bool keepAspect = true, Color? fillColor = null)- Resize with optionsResize(int width = -1, int height = -1, InterpolationMode = Default)- Resize with interpolationRotate(float angle)- Rotate image by angleGetRectangle(Rectangle)- Extract rectangular regionReplaceColorWithTransparency(Color)- Replace specific color with transparency
Color Extensions (Color)
Color Space Conversion
GetLuminance()- Calculate luminance (Y component in YUV)GetChrominanceU()- Calculate U chrominance componentGetChrominanceV()- Calculate V chrominance component
Color Comparison
IsLike(Color other, byte luminanceDelta = 24, byte chromaUDelta = 7, byte chromaVDelta = 6)- Compare colors in YUV space with toleranceIsLikeNaive(Color other, int tolerance = 2)- Simple RGB comparison with tolerance
Color Blending
BlendWith(Color other, float current, float max)- Interpolate between two colors
Graphics Extensions (Graphics)
DrawString(float x, float y, string text, Font font, Brush brush, ContentAlignment anchor)- Draw text with anchor positioningDrawCross(float/int x, float/int y, float/int size, Pen pen)- Draw cross marker (4 overloads including Point/PointF)DrawCircle(Pen pen, float centerX, float centerY, float radius)- Draw circle outlineFillCircle(Brush brush, float centerX, float centerY, float radius)- Draw filled circle
Rectangle Extensions (Rectangle)
MultiplyBy(int factor)- Scale rectangle uniformlyMultiplyBy(int xfactor, int yfactor)- Scale rectangle with different X/Y factorsCollidesWith(Rectangle/RectangleF)- Check rectangle collisionCollidesWith(Point/PointF)- Check if point is insideCollidesWith(int x, int y)/CollidesWith(float x, float y)- Check if coordinates are insideCenter()- Get center pointSetLeft/SetRight/SetTop/SetBottom(int)- Create new rectangle with modified edge
RectangleF Extensions (RectangleF)
(Similar methods to Rectangle, for floating-point rectangles)
Size Extensions (Size)
Center()- Get center point
Point Extensions (Point)
(Generated from T4 template - numeric operations on points)
FileInfo Extensions (FileInfo)
GetIcon(bool smallIcon = false, bool linkOverlay = false)- Get Windows shell icon for file- Uses native SHGetFileInfo API
Custom Types
IBitmapLocker Interface
Format-specific bitmap pixel access implementations:
- ARGB32BitmapLocker - 32-bit ARGB (Format32bppArgb)
- RGB32BitmapLocker - 32-bit RGB (Format32bppRgb)
- RGB24BitmapLocker - 24-bit RGB (Format24bppRgb)
- RGB565BitmapLocker - 16-bit RGB 565 (Format16bppRgb565)
- ARGB1555BitmapLocker - 16-bit ARGB 1555 (Format16bppArgb1555)
- Gray16BitmapLocker - 16-bit grayscale (Format16bppGrayScale)
- RGB555BitmapLocker - 16-bit RGB 555 (Format16bppRgb555)
- Indexed8BitmapLocker - 8-bit indexed (Format8bppIndexed)
- IndexedBitmapLocker - 1-bit and 4-bit indexed (Format1bppIndexed, Format4bppIndexed)
- UnsupportedDrawingBitmapLocker - Fallback for unsupported formats
Each locker provides optimized pixel access for its specific format.
Installation
dotnet add package FrameworkExtensions.System.Drawing
License
LGPL 3.0 or later - See LICENSE for details
| Product | Versions 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. net6.0-windows7.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
| .NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. 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 is compatible. net481 was computed. |
-
.NETCoreApp 3.1
- FrameworkExtensions.Backports (>= 1.0.0.183)
-
.NETFramework 3.5
- FrameworkExtensions.Backports (>= 1.0.0.183)
-
.NETFramework 4.0
- FrameworkExtensions.Backports (>= 1.0.0.183)
-
.NETFramework 4.5
- FrameworkExtensions.Backports (>= 1.0.0.183)
-
.NETFramework 4.8
- FrameworkExtensions.Backports (>= 1.0.0.183)
-
net6.0-windows7.0
- FrameworkExtensions.Backports (>= 1.0.0.183)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FrameworkExtensions.System.Drawing:
| Package | Downloads |
|---|---|
|
Hawkynt.ImageTransformUI
Shared WinForms UI for color reduction — quantizer/ditherer selection with live preview. Supports 40+ quantizers and 120+ ditherers from the FrameworkExtensions registry. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1.1347 | 128 | 6/3/2026 |
| 1.0.1.148 | 127 | 5/11/2026 |
| 1.0.1.146 | 133 | 5/4/2026 |
| 1.0.1.142 | 136 | 4/27/2026 |
| 1.0.0.134 | 161 | 3/2/2026 |
| 1.0.0.132 | 787 | 2/16/2026 |
| 1.0.0.119 | 148 | 2/9/2026 |
| 1.0.0.112 | 148 | 2/2/2026 |
| 1.0.0.108 | 152 | 1/26/2026 |
| 1.0.0.91 | 164 | 1/19/2026 |
| 1.0.0.79 | 175 | 1/5/2026 |
| 1.0.0.70 | 173 | 12/29/2025 |
| 1.0.0.55 | 260 | 12/22/2025 |
| 1.0.0.49 | 270 | 12/15/2025 |
| 1.0.0.46 | 270 | 9/29/2025 |
| 1.0.0.45 | 261 | 8/4/2025 |
| 1.0.0.37 | 242 | 7/7/2025 |
| 1.0.0.36 | 311 | 2/24/2025 |
| 1.0.0.35 | 396 | 6/24/2024 |
| 1.0.0.33 | 249 | 6/17/2024 |