FontFamily.GetCellDescent(FontStyle) Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Restituisce l'ascent di cella, in unità di progettazione, dell'oggetto FontFamily dello stile specificato.
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
Parametri
- style
- FontStyle
Enumerazione FontStyle che contiene le informazioni di stile per il tipo di carattere.
Restituisce
Descent di cella per questo oggetto FontFamily che usa l'enumerazione FontStyle specificata.
Esempio
L'esempio di codice seguente è progettato per l'uso con Windows Forms e richiede PaintEventArgse
, che è un parametro del Paint gestore eventi. Il codice esegue le azioni seguenti:
Crea un oggetto FontFamily.
Ottiene la discesa della cella per la famiglia di caratteri.
Disegna il valore della discesa della cella sullo schermo come testo.
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
Si applica a
Vedi anche
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: nel corso del 2024 verranno dismessi i problemi di GitHub come meccanismo di feedback per il contenuto e verranno sostituiti con un nuovo sistema di feedback. Per altre informazioni, vedere:Invia e visualizza il feedback per