FontFamily.GetCellAscent(FontStyle) 메서드

정의

지정된 스타일의 FontFamily에 대한 셀 상승을 디자인 단위로 반환합니다.

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

매개 변수

style
FontStyle

글꼴의 스타일 정보를 포함하는 FontStyle입니다.

반환

지정된 FontFamily을 사용하는 이 FontStyle의 셀 상승입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • FontFamily을 만듭니다.

  • 해당 글꼴 패밀리의 셀 상승을 가져옵니다.

  • 셀 상승 값을 텍스트로 화면에 그립니다.

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

적용 대상

추가 정보