FontFamily.GetCellDescent(FontStyle) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne la ligne descendante de la matrice du FontFamily du style spécifié, en unités de design.
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
Paramètres
Retours
Ligne descendante de la matrice de ce FontFamily utilisant le FontStyle spécifié.
Exemples
L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse
, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :
Crée un FontFamily.
Obtient la descente de cellule pour cette famille de polices.
Dessine la valeur de la descente de cellule à l’écran sous forme de texte.
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
S’applique à
Voir aussi
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour