FontFamily.GetCellAscent(FontStyle) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Devolve a subida da célula, em unidades de design, do FontFamily estilo especificado.
public:
int GetCellAscent(System::Drawing::FontStyle style);
public int GetCellAscent(System.Drawing.FontStyle style);
member this.GetCellAscent : System.Drawing.FontStyle -> int
Public Function GetCellAscent (style As FontStyle) As Integer
Parâmetros
Devoluções
A subida da célula para isto FontFamily que usa o especificado FontStyle.
Exemplos
O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, que é um parâmetro do tratador de eventos Paint. O código executa as seguintes ações:
Cria um FontFamily.
Obtém a ascensão de células para essa família de fontes.
Desenha o valor da subida da célula para o ecrã como texto.
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.Graphics.DrawString(
"ascentFontFamily.GetCellAscent() returns " + cellAscent.ToString() + ".",
new Font(ascentFontFamily, 16),
Brushes.Black,
new PointF(0, 0));
}
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