Hi,Support:
Does the aspose.imaging.dll supports text cutout overlay effect?If so,how to do it?
If not, it’s recommended this feature for update later.
The text cutout overlay effect looks like this:
111.jpg (21.4 KB)
Here is a code example, which may help:
using var backgroung = Image.Load(@"path to image");
int width = backgroung.Width;
int height = backgroung.Height;
var createOptions = new PngOptions
{
ColorType = Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha,
Source = new StreamSource(),
};
using var foreground = Image.Create(createOptions, width, height);
var g = new Aspose.Imaging.Graphics(foreground);
var layout = new RectangleF(0, height / 3, width, height);
var figure = new Figure();
figure.AddShape(new TextShape("HEY", layout, new Font("Arial", height * 0.15f), new StringFormat
{
Alignment = StringAlignment.Center,
}));
figure.AddShape(new RectangleShape(backgroung.Bounds));
var gPath = new GraphicsPath();
gPath.AddFigure(figure);
g.FillPath(new SolidBrush(Color.Red), gPath);
g = new Imaging.Graphics(backgroung);
g.DrawImage(foreground, 0, 0);
backgroung.Save(@"path to image");