Class
OfficeRasterText
OfficeIMO.Drawing
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
- text string?
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
- fontSize double = 16
- fontFamily string? = null
- cancellationToken System.Threading.CancellationToken = default
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
- text string?
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
- options OfficeIMO.Drawing.OfficeRasterTextOptions
- cancellationToken System.Threading.CancellationToken = default
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
- Target image width in pixels.
- height int
- Target image height in pixels.
- options OfficeIMO.Drawing.OfficeRasterTextOptions
- 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?
- fontSize double = 16
- fontFamily string? = null
- wrapWidth double? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeTextBlockLayoutpublic 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?
- Text to measure.
- options OfficeIMO.Drawing.OfficeRasterTextOptions
- Shared font and layout settings.
- wrapWidth double? = null
- Finite positive wrap width, required when Wrap is enabled.
- cancellationToken System.Threading.CancellationToken = default
- Observes cancellation during measurement and layout.
Returns
OfficeTextBlockLayout