CanvasDrawText Method |
// Load the image to work with. AtalaImage image = new AtalaImage(@"D:\Test Images\1.jpg"); // Create a Canvas for this image. Canvas canv = new Canvas(image); // Setup the text font options. Font fnt = new Font("Verdana", 36, FontStyle.Bold); // Find out the rendered size of the text. Size textSize = Canvas.CalculateTextSize("%%company%% DotImage", fnt); // Draw the text centered on the image. Point pt = new Point((image.Width - textSize.Width) / 2, (image.Height - textSize.Height) / 2); canv.DrawText("%%company%% DotImage", pt, fnt, new SolidFill(Color.Red), new SolidFill(Color.Transparent));
' Load the image to work with. Dim image As AtalaImage = New AtalaImage("D:\Test Images\1.jpg") ' Create a Canvas for this image. Dim canv As Canvas = New Canvas(image) ' Setup the text font options. Dim fnt As Font = New Font("Verdana", 36, FontStyle.Bold) ' Find out the rendered size of the text. Dim textSize As Size = Canvas.CalculateTextSize("%%company%% DotImage", fnt) ' Draw the text centered on the image. Dim pt As Point = New Point((image.Width - textSize.Width) / 2,(image.Height - textSize.Height) / 2) canv.DrawText("%%company%% DotImage", pt, fnt, New SolidFill(Color.Red), New SolidFill(Color.Transparent))
Name | Description | |
---|---|---|
DrawText(String, Point, Font, Fill) | Draw a single line text string onto this canvas specifying the upper left corner position. | |
DrawText(String, Rectangle, Font, Fill) | Draw multiline text onto this canvas specifying the rectangular bound area of the string. | |
DrawText(String, Point, Font, Fill, SolidFill) | Draw a single line text string onto this canvas specifying the upper left corner position and a solid
background color. | |
DrawText(String, Point, Font, Fill, TextFormat) | Draw a single line text string onto this canvas specifying the upper left corner position and text
formatting. | |
DrawText(String, Rectangle, Font, Fill, TextFormat) | Draw multiline text onto this canvas specifying the rectangular bound area of the string and text
formatting. | |
DrawText(String, Point, Font, Fill, SolidFill, TextFormat) | Draw a single line text string onto this canvas specifying the upper left corner position and a solid
background color. | |
DrawText(String, Rectangle, Font, Fill, SolidFill, TextFormat) | Draw a single line text string onto this canvas specifying the upper left corner position and a solid
background color. |
// Load the image to work with. AtalaImage image = new AtalaImage(@"D:\Test Images\1.jpg"); // Create a Canvas for this image. Canvas canv = new Canvas(image); // Setup the text font options. Font fnt = new Font("Verdana", 36, FontStyle.Bold); // Find out the rendered size of the text. Size textSize = Canvas.CalculateTextSize("%%company%% DotImage", fnt); // Draw the text centered on the image. Point pt = new Point((image.Width - textSize.Width) / 2, (image.Height - textSize.Height) / 2); canv.DrawText("%%company%% DotImage", pt, fnt, new SolidFill(Color.Red), new SolidFill(Color.Transparent));
' Load the image to work with. Dim image As AtalaImage = New AtalaImage("D:\Test Images\1.jpg") ' Create a Canvas for this image. Dim canv As Canvas = New Canvas(image) ' Setup the text font options. Dim fnt As Font = New Font("Verdana", 36, FontStyle.Bold) ' Find out the rendered size of the text. Dim textSize As Size = Canvas.CalculateTextSize("%%company%% DotImage", fnt) ' Draw the text centered on the image. Dim pt As Point = New Point((image.Width - textSize.Width) / 2,(image.Height - textSize.Height) / 2) canv.DrawText("%%company%% DotImage", pt, fnt, New SolidFill(Color.Red), New SolidFill(Color.Transparent))