FontFamily.GetCellAscent(FontStyle) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Belirtilen stilin tasarım birimleri FontFamily cinsinden hücre yükselişini döndürür.
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
Parametreler
Döndürülenler
Belirtilen FontStyleöğesini kullanan bunun FontFamily hücre yükselişi.
Örnekler
Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin Paint bir parametresi olan gerektirir.PaintEventArgse
Kod aşağıdaki eylemleri gerçekleştirir:
bir FontFamilyoluşturur.
Bu yazı tipi ailesinin hücre yükselişini alır.
Hücrenin yükseliş değerini ekrana metin olarak çizer.
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
Şunlara uygulanır
Ayrıca bkz.
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin