|
|
|
@ -16,7 +16,6 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <summary>
|
|
|
|
/// Draws the text onto the the image filled via the brush.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The type of the color.</typeparam>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="text">The text.</param>
|
|
|
|
/// <param name="font">The font.</param>
|
|
|
|
@ -25,14 +24,17 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <returns>
|
|
|
|
/// The <see cref="Image{TPixel}" />.
|
|
|
|
/// </returns>
|
|
|
|
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, TPixel color, PointF location) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> source.DrawText(TextGraphicsOptions.Default, text, font, color, location); |
|
|
|
public static IImageProcessingContext DrawText( |
|
|
|
this IImageProcessingContext source, |
|
|
|
string text, |
|
|
|
Font font, |
|
|
|
Color color, |
|
|
|
PointF location) => |
|
|
|
source.DrawText(TextGraphicsOptions.Default, text, font, color, location); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Draws the text onto the the image filled via the brush.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The type of the color.</typeparam>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="text">The text.</param>
|
|
|
|
@ -42,14 +44,18 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <returns>
|
|
|
|
/// The <see cref="Image{TPixel}" />.
|
|
|
|
/// </returns>
|
|
|
|
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, TextGraphicsOptions options, string text, Font font, TPixel color, PointF location) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> source.DrawText(options, text, font, Brushes.Solid(color), null, location); |
|
|
|
public static IImageProcessingContext DrawText( |
|
|
|
this IImageProcessingContext source, |
|
|
|
TextGraphicsOptions options, |
|
|
|
string text, |
|
|
|
Font font, |
|
|
|
Color color, |
|
|
|
PointF location) => |
|
|
|
source.DrawText(options, text, font, Brushes.Solid(color), null, location); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Draws the text onto the the image filled via the brush.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The type of the color.</typeparam>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="text">The text.</param>
|
|
|
|
/// <param name="font">The font.</param>
|
|
|
|
@ -58,14 +64,17 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <returns>
|
|
|
|
/// The <see cref="Image{TPixel}" />.
|
|
|
|
/// </returns>
|
|
|
|
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, PointF location) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> source.DrawText(TextGraphicsOptions.Default, text, font, brush, location); |
|
|
|
public static IImageProcessingContext DrawText( |
|
|
|
this IImageProcessingContext source, |
|
|
|
string text, |
|
|
|
Font font, |
|
|
|
IBrush brush, |
|
|
|
PointF location) => |
|
|
|
source.DrawText(TextGraphicsOptions.Default, text, font, brush, location); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Draws the text onto the the image filled via the brush.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The type of the color.</typeparam>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="text">The text.</param>
|
|
|
|
@ -75,14 +84,18 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <returns>
|
|
|
|
/// The <see cref="Image{TPixel}" />.
|
|
|
|
/// </returns>
|
|
|
|
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, TextGraphicsOptions options, string text, Font font, IBrush<TPixel> brush, PointF location) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> source.DrawText(options, text, font, brush, null, location); |
|
|
|
public static IImageProcessingContext DrawText( |
|
|
|
this IImageProcessingContext source, |
|
|
|
TextGraphicsOptions options, |
|
|
|
string text, |
|
|
|
Font font, |
|
|
|
IBrush brush, |
|
|
|
PointF location) => |
|
|
|
source.DrawText(options, text, font, brush, null, location); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Draws the text onto the the image outlined via the pen.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The type of the color.</typeparam>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="text">The text.</param>
|
|
|
|
/// <param name="font">The font.</param>
|
|
|
|
@ -91,14 +104,17 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <returns>
|
|
|
|
/// The <see cref="Image{TPixel}" />.
|
|
|
|
/// </returns>
|
|
|
|
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IPen<TPixel> pen, PointF location) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> source.DrawText(TextGraphicsOptions.Default, text, font, pen, location); |
|
|
|
public static IImageProcessingContext DrawText( |
|
|
|
this IImageProcessingContext source, |
|
|
|
string text, |
|
|
|
Font font, |
|
|
|
IPen pen, |
|
|
|
PointF location) => |
|
|
|
source.DrawText(TextGraphicsOptions.Default, text, font, pen, location); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Draws the text onto the the image outlined via the pen.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The type of the color.</typeparam>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="text">The text.</param>
|
|
|
|
@ -108,14 +124,18 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <returns>
|
|
|
|
/// The <see cref="Image{TPixel}" />.
|
|
|
|
/// </returns>
|
|
|
|
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, TextGraphicsOptions options, string text, Font font, IPen<TPixel> pen, PointF location) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> source.DrawText(options, text, font, null, pen, location); |
|
|
|
public static IImageProcessingContext DrawText( |
|
|
|
this IImageProcessingContext source, |
|
|
|
TextGraphicsOptions options, |
|
|
|
string text, |
|
|
|
Font font, |
|
|
|
IPen pen, |
|
|
|
PointF location) => |
|
|
|
source.DrawText(options, text, font, null, pen, location); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Draws the text onto the the image filled via the brush then outlined via the pen.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The type of the color.</typeparam>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="text">The text.</param>
|
|
|
|
/// <param name="font">The font.</param>
|
|
|
|
@ -125,14 +145,18 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <returns>
|
|
|
|
/// The <see cref="Image{TPixel}" />.
|
|
|
|
/// </returns>
|
|
|
|
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, PointF location) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> source.DrawText(TextGraphicsOptions.Default, text, font, brush, pen, location); |
|
|
|
public static IImageProcessingContext DrawText( |
|
|
|
this IImageProcessingContext source, |
|
|
|
string text, |
|
|
|
Font font, |
|
|
|
IBrush brush, |
|
|
|
IPen pen, |
|
|
|
PointF location) => |
|
|
|
source.DrawText(TextGraphicsOptions.Default, text, font, brush, pen, location); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Draws the text using the default resolution of <value>72dpi</value> onto the the image filled via the brush then outlined via the pen.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TPixel">The type of the color.</typeparam>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="text">The text.</param>
|
|
|
|
@ -143,8 +167,14 @@ namespace SixLabors.ImageSharp.Processing |
|
|
|
/// <returns>
|
|
|
|
/// The <see cref="Image{TPixel}" />.
|
|
|
|
/// </returns>
|
|
|
|
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, TextGraphicsOptions options, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, PointF location) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
=> source.ApplyProcessor(new DrawTextProcessor<TPixel>(options, text, font, brush, pen, location)); |
|
|
|
public static IImageProcessingContext DrawText( |
|
|
|
this IImageProcessingContext source, |
|
|
|
TextGraphicsOptions options, |
|
|
|
string text, |
|
|
|
Font font, |
|
|
|
IBrush brush, |
|
|
|
IPen pen, |
|
|
|
PointF location) => |
|
|
|
source.ApplyProcessor(new DrawTextProcessor(options, text, font, brush, pen, location)); |
|
|
|
} |
|
|
|
} |