FontFamily.GetCellAscent-Methode
Gibt den Zellaufstieg (Versalhöhe) für das FontFamily-Objekt des angegebenen Schriftschnitts in Entwurfseinheiten zurück.
Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)
Syntax
'Declaration
Public Function GetCellAscent ( _
style As FontStyle _
) As Integer
'Usage
Dim instance As FontFamily
Dim style As FontStyle
Dim returnValue As Integer
returnValue = instance.GetCellAscent(style)
public int GetCellAscent (
FontStyle style
)
public:
int GetCellAscent (
FontStyle style
)
public int GetCellAscent (
FontStyle style
)
public function GetCellAscent (
style : FontStyle
) : int
Parameter
- style
Ein FontStyle, der Informationen zum Schriftschnitt der Schriftart enthält.
Rückgabewert
Der Zellaufstieg für dieses FontFamily-Objekt, das den angegebenen FontStyle verwendet.
Beispiel
Das folgende Codebeispiel ist für die Verwendung mit Windows Forms vorgesehen und erfordert PaintEventArgse, wobei es sich um einen Parameter des Paint-Ereignishandlers handelt. Der Code führt die folgenden Aktionen aus:
Erstellt eine FontFamily.
Ruft den Zellaufstieg (Versalhöhe) für die Schriftartfamilie ab.
Zeichnet den Wert des Zellaufstiegs (Versalhöhe) als Text auf dem Bildschirm.
Public Sub GetCellAscent_Example(ByVal e As PaintEventArgs)
' Create a FontFamily object.
Dim ascentFontFamily As New FontFamily("arial")
' Get the cell ascent of the font family in design units.
Dim cellAscent As Integer = _
ascentFontFamily.GetCellAscent(FontStyle.Regular)
' Draw the result as a string to the screen.
e.Graphics.DrawString("ascentFontFamily.GetCellAscent() returns " _
& cellAscent.ToString() & ".", New Font(ascentFontFamily, 16), _
Brushes.Black, New PointF(0, 0))
End Sub
public void GetCellAscent_Example(PaintEventArgs e)
{
// Create a FontFamily object.
FontFamily ascentFontFamily = new FontFamily("arial");
// Get the cell ascent of the font family in design units.
int cellAscent = ascentFontFamily.GetCellAscent(FontStyle.Regular);
// Draw the result as a string to the screen.
e.Graphics.DrawString(
"ascentFontFamily.GetCellAscent() returns " + cellAscent.ToString() + ".",
new Font(ascentFontFamily, 16),
Brushes.Black,
new PointF(0, 0));
}
public:
void GetCellAscent_Example( PaintEventArgs^ e )
{
// Create a FontFamily object.
FontFamily^ ascentFontFamily = gcnew FontFamily( "arial" );
// Get the cell ascent of the font family in design units.
int cellAscent = ascentFontFamily->GetCellAscent( FontStyle::Regular );
// Draw the result as a string to the screen.
e->Graphics->DrawString( String::Format( "ascentFontFamily.GetCellAscent() returns {0}.", cellAscent ),
gcnew System::Drawing::Font( ascentFontFamily,16 ), Brushes::Black, PointF(0,0) );
}
public void GetCellAscent_Example(PaintEventArgs e)
{
// Create a FontFamily object.
FontFamily ascentFontFamily = new FontFamily("arial");
// Get the cell ascent of the font family in design units.
int cellAscent = ascentFontFamily.GetCellAscent(FontStyle.Regular);
// Draw the result as a string to the screen.
e.get_Graphics().DrawString("ascentFontFamily.GetCellAscent() returns "
+ System.Convert.ToString(cellAscent) + ".",
new Font(ascentFontFamily, 16),
Brushes.get_Black(), new PointF(0, 0));
} //GetCellAscent_Example
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
FontFamily-Klasse
FontFamily-Member
System.Drawing-Namespace