Type Default Value Read Only Static Description
Double None Yes No The font line height, in pixels.

The maximum height of a text character, using TextFont.

This is the sum of the font ascent and descent.

See Also




Here we draw an image and a text caption on a Canvas. We centre horizontally text and image. The image is aligned to the top (the default) and the caption to the bottom.


Canvas canvas = new Canvas();
XImage image = XImage.FromFile(Server.MapPath("rez/boat.gif"));
DrawOptions drawOpts = new DrawOptions();
drawOpts.HAlign = 0.5;
drawOpts.VAlign = 0;
drawOpts.TextHAlign = 0.5;
drawOpts.TextVAlign = 1;
XText caption = canvas.GetTextMetrics("My image caption", drawOpts);
canvas.Width = image.Width + 40;
canvas.Height = image.Height + caption.LineHeight;
canvas.DrawImage(image, drawOpts);
canvas.DrawText(caption.Text, drawOpts);

[Visual Basic]

Dim canvas As New Canvas()
Dim image As XImage = XImage.FromFile(Server.MapPath("rez/boat.gif"))
Dim drawOpts As New DrawOptions()
drawOpts.HAlign = 0.5
drawOpts.VAlign = 0
drawOpts.TextHAlign = 0.5
drawOpts.TextVAlign = 1
Dim caption As XText = canvas.GetTextMetrics("My image caption", drawOpts)
canvas.Width = image.Width + 40
canvas.Height = image.Height + caption.LineHeight
canvas.DrawImage(image, drawOpts)
canvas.DrawText(caption.Text, drawOpts)