Art text
View as MarkdownShows different types of art texts.
Code Snippet
using (var bitmap = new Bitmap(600, 400, PixelFormat.Format24bppRgb, new RgbColor(0xff, 0xff, 0xff, 0xff)))
using (var graphics = bitmap.GetGraphics())
{
var font = graphics.CreateFont("Arial", 48);
var brush = new SolidBrush(new RgbColor(0x41, 0x41, 0x41));
var texts = new Aurigma.GraphicsMill.Drawing.Text[]
{
new BridgeText("Bridge Text", font, brush)
{
Center = new System.Drawing.PointF(150f, 50f),
Bend = 0.2f,
},
new BulgeText("Bulge Text", font, brush)
{
Center = new System.Drawing.PointF(150f, 150f),
Bend = 0.2f,
},
new PinchText("Pinch Text", font, brush)
{
Center = new System.Drawing.PointF(150f, 250f),
Bend = 0.2f,
},
new RoofText("Roof Text", font, brush)
{
Center = new System.Drawing.PointF(150f, 350f),
Bend = -0.2f,
},
new ValleyText("Valley Text", font)
{
Brush = new SolidBrush(RgbColor.Yellow),
Pen = new Pen(RgbColor.Red, 2f),
Center = new System.Drawing.PointF(450f, 50f),
Bend = 0.2f,
},
new WedgeText("Wedge Text", font, brush)
{
Center = new System.Drawing.PointF(450f, 150f),
LeftScale = 2.0f,
RightScale = 0.7f,
Tilt = -0.3f,
Effect = new Shadow(new RgbColor(80, 80, 80), 5, 4, 4),
},
new RoundText("Round Text", font, brush)
{
Center = new System.Drawing.PointF(450f, 300f),
Bend = 1,
Effect = new Glow(new RgbColor(0x66, 0xaf, 0xe9), 5),
},
};
foreach (var text in texts)
{
graphics.DrawText(text);
}
bitmap.Save("ArtText.png");
}
Output
ArtText.png
Used APIs
- Aurigma.GraphicsMill.Bitmap.GetGraphics
- Aurigma.GraphicsMill.Drawing.Art.ArtText.Center
- Aurigma.GraphicsMill.Drawing.Art.BridgeText
- Aurigma.GraphicsMill.Drawing.Art.BridgeText.Bend
- Aurigma.GraphicsMill.Drawing.Art.BulgeText
- Aurigma.GraphicsMill.Drawing.Art.BulgeText.Bend
- Aurigma.GraphicsMill.Drawing.Art.PinchText
- Aurigma.GraphicsMill.Drawing.Art.PinchText.Bend
- Aurigma.GraphicsMill.Drawing.Art.RoofText
- Aurigma.GraphicsMill.Drawing.Art.RoofText.Bend
- Aurigma.GraphicsMill.Drawing.Art.RoundText
- Aurigma.GraphicsMill.Drawing.Art.RoundText.Bend
- Aurigma.GraphicsMill.Drawing.Art.ValleyText
- Aurigma.GraphicsMill.Drawing.Art.ValleyText.Bend
- Aurigma.GraphicsMill.Drawing.Art.WedgeText
- Aurigma.GraphicsMill.Drawing.Art.WedgeText.LeftScale
- Aurigma.GraphicsMill.Drawing.Art.WedgeText.RightScale
- Aurigma.GraphicsMill.Drawing.Art.WedgeText.Tilt
- Aurigma.GraphicsMill.Drawing.Effects.Glow
- Aurigma.GraphicsMill.Drawing.Effects.Shadow
- Aurigma.GraphicsMill.Drawing.Graphics.CreateFont(String,Single)
- Aurigma.GraphicsMill.Drawing.Graphics.DrawText(Text)
- Aurigma.GraphicsMill.Drawing.Pen
- Aurigma.GraphicsMill.Drawing.SolidBrush
- Aurigma.GraphicsMill.Drawing.Text
- Aurigma.GraphicsMill.Drawing.Text.Brush
- Aurigma.GraphicsMill.Drawing.Text.Effect
- Aurigma.GraphicsMill.Drawing.Text.Pen