Rop.Winforms10.Helpers 1.0.1

dotnet add package Rop.Winforms10.Helpers --version 1.0.1
                    
NuGet\Install-Package Rop.Winforms10.Helpers -Version 1.0.1
                    
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="Rop.Winforms10.Helpers" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rop.Winforms10.Helpers" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Rop.Winforms10.Helpers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rop.Winforms10.Helpers --version 1.0.1
                    
#r "nuget: Rop.Winforms10.Helpers, 1.0.1"
                    
#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.
#:package Rop.Winforms10.Helpers@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rop.Winforms10.Helpers&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Rop.Winforms10.Helpers&version=1.0.1
                    
Install as a Cake Tool

Rop.Winforms10.Helpers

Helper classes for WinForms on .NET 10. Provides utilities for bitmap processing, drawing extensions, geometry helpers, color manipulation, and font metrics.

Installation

dotnet add package Rop.Winforms10.Helpers

Features

Bitmaps (Rop.Winforms10.Bitmaps)

Low-level bitmap and color manipulation with explicit memory layout control.

  • ImageHelper — Convert between byte[] and Image/Bitmap with optional format conversion.
  • Bitmap8 — 8-bit indexed bitmap wrapper with palette support and flood-fill.
  • Pixels8 / Pixels32 — Typed pixel buffers (byte and Color32) with Span access per scanline.
  • Color24 / Color32 — Explicit-layout (StructLayout.Explicit) color structs with implicit conversion to/from System.Drawing.Color, bitwise operators (|, &, ^, !), scaling (*, <<, >>), and bit-mask creation.
  • OctTree — Octree-based color quantization for reducing palettes.
using Rop.Winforms10.Bitmaps;

// Convert bytes to image
Image img = ImageHelper.ImageFromBytes(byteArray);
Bitmap bmp = ImageHelper.BitmapFromBytes(byteArray);

// 8-bit indexed with flood fill
var bmp8 = new Bitmap8(myBitmap);
bmp8.Flood(new Point(10, 10), 3);

// Color32 bitwise operations
Color32 c = Color.Red;
Color32 inverted = !c;
Color32 halfBright = c * 0.5f;

Drawing (Rop.Winforms10.Drawing)

Extensions for Graphics, color manipulation, and geometric helpers.

Graphics Extensions (HelperDrawing):

  • Load fonts from in-memory byte arrays.
  • Measure and draw text aligned to baseline.
  • Draw text with ContentAlignment within a rectangle.
  • Convert between GraphicsUnit values.
using Rop.Winforms10.Drawing;

// Load font from embedded resource
pfc.AddMemoryFont(File.ReadAllBytes("MyFont.ttf"));

// Draw text aligned to baseline
g.DrawOnBaseline("Hello", font, Brushes.Black, new PointF(10, 30));

// Draw aligned text
g.DrawAligmentString("Centered", font, brush, rect, ContentAlignment.MiddleCenter, sf);

Colors (Rop.Winforms10.Drawing.Colors):

  • ColorHelper — Extension methods on Color: OkLCh adjustments (lightness, chroma, hue), ARGB delta, transparent/empty checks.
  • ColorOkLch — OkLCh color space representation with delta operations and alpha support.
  • ColorF — Floating-point color (1.0f = 255) with component scaling.
  • ColorNames — Named color lookup utilities.
using Rop.Winforms10.Drawing.Colors;

Color lighter = myColor.AddL(0.1f);   // increase lightness in OkLCh
Color vivid = myColor.AddC(0.05f);   // increase chroma
Color shifted = myColor.AddH(15);    // shift hue by 15 degrees

Geometry (Rop.Winforms10.Drawing.Geom):

  • HelperGeom — Extension methods for PointF, SizeF, RectangleF: distance, diagonal, center calculation, arithmetic operations, zip (interpolation), midpoint wrapping, tuple deconstruction.
  • HelperGeom.Integer / HelperGeom.Float — Point and size arithmetic for int and float types.
  • HelperRectangle — Rectangle helpers: fit to bounds, find intersection, proportional resize.
  • HelperUnits — Conversion between GraphicsUnit values (pixels ↔ points ↔ millimeters ↔ inches).
  • BorderHelper — Draw borders with specified corner styles (square, round).
  • RoundedRectangle — Rounded rectangle geometry calculation.
  • RectangleD — Double-precision rectangle struct.
  • RectangleCorners — Corner radius specification per corner.
  • GraphicsPathExGraphicsPath extensions.
using Rop.Winforms10.Drawing.Geom;

float dist = PointF.Distance(p1, p2);
SizeF diff = PointF.Diff(p1, p2);
PointF center = rect.Center();
float mm = 10f.MillimetersToPixels(g);

Fonts (Rop.Winforms10.Fonts)

Font metrics and text measurement with baseline/ascender awareness.

  • FontHelper — Extension methods on Font and Graphics: ascent in points/units/pixels, points-to-pixels conversion, text measurement with ascent.
  • FontSizeF — Size with an Ascent field for baseline-aware layout.
  • FontRectangleF — Rectangle with Ascent, Descent, and BaseLine properties. Includes AscentBounds and DescentBounds computed rectangles.
using Rop.Winforms10.Fonts;

int ascentPx = myFont.GetAscentPixels(graphics);
FontRectangleF rect = g.MeasureStringWithBaseLine(myFont, new PointF(10, 30), "Hello World");

// Access baseline-aware regions
RectangleF ascentArea = rect.AscentBounds;
RectangleF descentArea = rect.DescentBounds;

Requirements

  • .NET 10 (net10.0-windows)
  • Windows Forms (UseWindowsForms=true)

License

GPL-3.0-or-later

Author

Ramon Ordiales Plaza

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-windows7.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Rop.Winforms10.Helpers:

Package Downloads
Rop.Winforms10.DuotoneIcons

DuoTone Icon classes for Winforms

Rop.Winforms10

Base forms, KeyValue-aware ComboBox/ListBox controls, and helpers for WinForms on .NET 10

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 152 6/25/2026
1.0.0 120 6/25/2026