Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeRasterText

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
1d5ef38d1e0b with working tree changes
Modifiers
static

Text layout and raster effects shared by managed image-editing consumers.

Inheritance

  • object
  • OfficeRasterText

Methods

Draw 2 overloads
public static void Draw(OfficeRasterImage target, string? text, double x, double y, double width, double height, OfficeColor color, double fontSize = 16, string? fontFamily = null, CancellationToken cancellationToken = default) #

Draws measured text, optional shadow, and a rounded raster outline over existing pixels.

Parameters

target OfficeIMO.Drawing.OfficeRasterImage required
text string? required
x double required
y double required
width double required
height double required
color OfficeIMO.OfficeColor required
fontSize double = 16 optional
fontFamily string? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public static void Draw(OfficeRasterImage target, string? text, double x, double y, double width, double height, OfficeColor color, OfficeRasterTextOptions options, CancellationToken cancellationToken = default) #

Draws text and optional effects with the same shared font and layout settings used by measurement.

Parameters

target OfficeIMO.Drawing.OfficeRasterImage required
text string? required
x double required
y double required
width double required
height double required
color OfficeIMO.OfficeColor required
options OfficeIMO.Drawing.OfficeRasterTextOptions required
cancellationToken System.Threading.CancellationToken = default optional
public static long EstimateAdditionalWorkingBytes(int width, int height, OfficeRasterTextOptions options) #

Estimates peak managed text scratch storage beyond the target RGBA pixel buffer.

Parameters

width int required
Target image width in pixels.
height int required
Target image height in pixels.
options OfficeIMO.Drawing.OfficeRasterTextOptions required
Shared text and effect settings used by drawing.

Returns

long Additional bytes to retain in a composed operation's working-set budget.
Measure 2 overloads
public static OfficeTextBlockLayout Measure(string? text, double fontSize = 16, string? fontFamily = null, double? wrapWidth = null, CancellationToken cancellationToken = default) #

Measures authored lines or wraps them to a requested width using managed font metrics.

Parameters

text string? required
fontSize double = 16 optional
fontFamily string? = null optional
wrapWidth double? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public static OfficeTextBlockLayout Measure(string? text, OfficeRasterTextOptions options, double? wrapWidth = null, CancellationToken cancellationToken = default) #

Measures text using the same captured font and layout settings as raster drawing.

Parameters

text string? required
Text to measure.
options OfficeIMO.Drawing.OfficeRasterTextOptions required
Shared font and layout settings.
wrapWidth double? = null optional
Finite positive wrap width, required when Wrap is enabled.
cancellationToken System.Threading.CancellationToken = default optional
Observes cancellation during measurement and layout.