FontFamily.GetCellDescent(FontStyle) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
以設計單位傳回指定樣式 FontFamily 的儲存格下降。
public:
int GetCellDescent(System::Drawing::FontStyle style);
public int GetCellDescent (System.Drawing.FontStyle style);
member this.GetCellDescent : System.Drawing.FontStyle -> int
Public Function GetCellDescent (style As FontStyle) As Integer
參數
傳回
這個 FontFamily 的儲存格下降計量,使用指定的 FontStyle。
範例
下列程式代碼範例是專為搭配 Windows Forms 使用而設計,而且需要 PaintEventArgse
,這是 Paint 事件處理程式的參數。 程式代碼會執行下列動作:
建立 FontFamily。
取得該字型系列的數據格下降。
將儲存格下降到螢幕的值繪製為文字。
public:
void GetCellDescent_Example( PaintEventArgs^ e )
{
// Create a FontFamily object.
FontFamily^ descentFontFamily = gcnew 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( String::Format( "descentFontFamily.GetCellDescent() returns {0}.", cellDescent ),
gcnew System::Drawing::Font( descentFontFamily,16 ), Brushes::Black, PointF(0,0) );
}
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));
}
Public Sub GetCellDescent_Example(ByVal e As PaintEventArgs)
' Create a FontFamily object.
Dim descentFontFamily As New FontFamily("arial")
' Get the cell descent of the font family in design units.
Dim cellDescent As Integer = _
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))
End Sub