AppDimens.Net.Resize 3.6.1

dotnet add package AppDimens.Net.Resize --version 3.6.1
                    
NuGet\Install-Package AppDimens.Net.Resize -Version 3.6.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="AppDimens.Net.Resize" Version="3.6.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AppDimens.Net.Resize" Version="3.6.1" />
                    
Directory.Packages.props
<PackageReference Include="AppDimens.Net.Resize" />
                    
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 AppDimens.Net.Resize --version 3.6.1
                    
#r "nuget: AppDimens.Net.Resize, 3.6.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 AppDimens.Net.Resize@3.6.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=AppDimens.Net.Resize&version=3.6.1
                    
Install as a Cake Addin
#tool nuget:?package=AppDimens.Net.Resize&version=3.6.1
                    
Install as a Cake Tool

AppDimens.Net.Resize

Auto-resize math — the largest font size or square side that fits a box (bounded steps + binary search).

Part of AppDimens for .NET · requires AppDimens.Net · net8.0–net10.0.

📖 Complete guide: AppDimens.Net.Resize documentation · API reference: API.md

Install

dotnet add package AppDimens.Net.Resize

Use

using AppDimens.Net;
using AppDimens.Net.Code.Resize;

var ctx = AppDimensAmbient.Require();

float fontSp = DimenResize.AutoResizeTextPx("Black Friday — 70% OFF", boxWidthPx: 600f,
    minSp: 12f, maxSp: 32f, stepSp: 1f, maxLines: 2, ctx: ctx);          // result in sp
float iconDp = DimenResize.AutoResizeSquarePx(300f, 180f, minDp: 24f, maxDp: 120f, stepDp: 4f, ctx: ctx);  // result in dp
var (innerW, innerH) = DimenResize.InnerMaxDimensionsPx(400f, 200f, 16f, 16f, 8f, 8f);
float best = new ResizeRangePx(10f, 40f, 2f).ResolveFitting(px => px * 12 <= 300);

Box sizes are pixels; results come back in the unit of your range (text → sp, square → dp) despite the Px suffix.

Português

DimenResize.AutoResizeTextPx(...) encontra o maior tamanho de fonte (sp) que cabe na caixa; AutoResizeSquarePx(...) faz o mesmo para ícones (dp).


Apache-2.0 — © Jean Bodenberg · Repository · Formulas are bit-for-bit ports of appdimens-kmp

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AppDimens.Net.Resize:

Package Downloads
AppDimens.Net.Sdk

AppDimens .NET meta-package ("BOM"): pulls the principal library plus every strategy module with a single reference.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.6.1 105 10/12/2026
3.6.0 158 8/23/2026