本文整理汇总了C#中System.Drawing.FontFamily.GetCellDescent方法的典型用法代码示例。如果您正苦于以下问题:C# FontFamily.GetCellDescent方法的具体用法?C# FontFamily.GetCellDescent怎么用?C# FontFamily.GetCellDescent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.FontFamily
的用法示例。
在下文中一共展示了FontFamily.GetCellDescent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCellDescent_Example
public void GetCellDescent_Example(PaintEventArgs e)
{
// Create a FontFamily object.
FontFamily descentFontFamily = new FontFamily("arial");
// Get the cell descent of the font family in design units.
int cellDescent = descentFontFamily.GetCellDescent(FontStyle.Regular);
// Draw the result as a string to the screen.
e.Graphics.DrawString(
"descentFontFamily.GetCellDescent() returns " + cellDescent.ToString() + ".",
new Font(descentFontFamily, 16),
Brushes.Black,
new PointF(0, 0));
}
示例2: Main
//引入命名空间
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Drawing.Imaging;
public class Test
{
static void Main()
{
// Create the format string
String formatString = "{0,-16}{1,8}{2,9}{3,10}{4,14}";
// Write the first line of the table
Console.WriteLine(formatString, "Font Family Name", "Ascent", "Descent",
"EmHeight", "Line Spacing");
// Write font metrics for Courier New font family
FontFamily ff = new FontFamily("Courier New");
Console.WriteLine(formatString, ff.GetName(0),
ff.GetCellAscent(FontStyle.Regular),
ff.GetCellDescent(FontStyle.Regular),
ff.GetEmHeight(FontStyle.Regular),
ff.GetLineSpacing(FontStyle.Regular));
}
}