How to draw the stroked text with blur and soft edge on to an image?

Hi, Support:

How to draw the stroked text with blur and soft edge on to an image? please see the example image attached.
Thanks for your help.

Text-With-Soft-blue-shade stroke-edge.jpg (71.4 KB)

@ducaisoft,

Thanks for the sample image.

We will evaluate your requirements and may devise code segment (if possible) using Aspose.Drawing API. We have opened the following new ticket(s) in our internal issue tracking system and will try to deliver code snippets according to the terms mentioned in Free Support Policies.

Issue ID(s): DRAWINGNET-1599

Once we have an update on it, we will let you know here.

@ducaisoft,

You can use the following sample code to accomplish your task:

using Aspose.Drawing;
using Aspose.Drawing.Drawing2D;

Bitmap bmp = new Bitmap(919, 425);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.Gray);

string text = "11:56";
int fontSize = 350;
FontFamily fontFamily = new FontFamily("Segoe UI");
FontStyle fontStyle = FontStyle.Regular;
StringFormat stringFormat = StringFormat.GenericTypographic;
Point p = new Point(20, 0);

Font font = new(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
g.DrawString(text, font, Brushes.White, p, stringFormat);

GraphicsPath path = new GraphicsPath();
path.AddString(text, fontFamily, (int)fontStyle, fontSize, p, stringFormat);
g.DrawPath(new Pen(Color.FromArgb(20, Color.Black), 10), path);

bmp.Save("out.png")

out.png (7.7 KB)

Let us know if you still have further queries or comments.

Thanks for your demo.
However, what is not the same as one the sample text effect shows. the right text effect may be outer soft glow effect is PS. Would you know how to implement it?

@ducaisoft,

We appreciate your feedback. We will thoroughly evaluate your requirements and closely examine the outer soft glow effect of the text. Then, we will devise or refine the code segment, if possible. Once we have an update, we will inform you.

@ducaisoft,

We examined your requirements more thoroughly. Please note that Aspose.Drawing is a low-level graphics library and does not have this type of built-in effect.

We apologize for any inconvenience this may have caused you.