Wrapping Paths
View as MarkdownIllustrates the utilization of wrapping paths for excluding specific regions for text layout.
Code Snippet
using (var bitmap = new Bitmap(400, 400, PixelFormat.Format32bppArgb, RgbColor.White))
using (var gr = bitmap.GetGraphics())
{
var wrappingPath = new Path();
wrappingPath.DrawEllipse(180, 0, 70, 350);
var text = new BoundedText(Texts.LoremIpsum, gr.CreateFont("Arial", 20))
{
Rectangle = new System.Drawing.RectangleF(50, 50, 300, 300),
};
text.WrappingPaths.Add(wrappingPath);
gr.DrawRectangle(new Pen(RgbColor.Blue), text.Rectangle);
gr.DrawPath(new Pen(RgbColor.Red), wrappingPath);
gr.DrawText(text);
bitmap.Save("WrappingPaths.png");
}
Output
WrappingPaths.png
Used APIs
- Aurigma.GraphicsMill.Bitmap.GetGraphics
- Aurigma.GraphicsMill.Drawing.BoundedText
- Aurigma.GraphicsMill.Drawing.BoundedText.Rectangle
- Aurigma.GraphicsMill.Drawing.Graphics.CreateFont(String,Single)
- Aurigma.GraphicsMill.Drawing.Graphics.DrawPath(Pen,Path)
- Aurigma.GraphicsMill.Drawing.Graphics.DrawRectangle(Pen,RectangleF)
- Aurigma.GraphicsMill.Drawing.Graphics.DrawText(Text)
- Aurigma.GraphicsMill.Drawing.Path
- Aurigma.GraphicsMill.Drawing.Path.DrawEllipse(Single,Single,Single,Single)
- Aurigma.GraphicsMill.Drawing.Pen
- Aurigma.GraphicsMill.Drawing.Text.WrappingPaths