Here we draw some text on a Canvas using specific text color,
size and font.
[C#]
Canvas canvas = new Canvas();
DrawOptions drawOpts = new DrawOptions();
drawOpts.TextFont = "Segoe Script";
drawOpts.TextSize = 18;
drawOpts.TextColor = new XColor(Color.Gold);
canvas.DrawText("Here is some text to draw...", drawOpts);
canvas.SaveAs(Server.MapPath("DrawOptions_Various_99.png"));
[Visual Basic]
Dim canvas As New Canvas()
Dim drawOpts As New DrawOptions()
drawOpts.TextFont = "Segoe Script"
drawOpts.TextSize = 18
drawOpts.TextColor = New XColor(Color.Gold)
canvas.DrawText("Here is some text to draw...", drawOpts)
canvas.SaveAs(Server.MapPath("DrawOptions_Various_99.png"))
DrawOptions_Various_99.png
|