クリックして評価とフィードバックをお寄せください
MSDN
MSDN ライブラリ
.NET 開発
以前のバージョン
.NET Framework SDK 2.0
System.Drawing
FontFamily クラス
FontFamily メソッド
 GetCellAscent メソッド

  低帯域幅での表示をオンにする
このページは次のバージョンについて記述しています。
Microsoft Visual Studio 2005/.NET Framework 2.0

その他のバージョンについては、以下の情報を参照してください。
.NET Framework クラス ライブラリ
FontFamily.GetCellAscent メソッド

指定したスタイルの FontFamily のセル アセントをデザイン単位で返します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)

Visual Basic (宣言)
Public Function GetCellAscent ( _
    style As FontStyle _
) As Integer
Visual Basic (使用法)
Dim instance As FontFamily
Dim style As FontStyle
Dim returnValue As Integer

returnValue = instance.GetCellAscent(style)
C#
public int GetCellAscent (
    FontStyle style
)
C++
public:
int GetCellAscent (
    FontStyle style
)
J#
public int GetCellAscent (
    FontStyle style
)
JScript
public function GetCellAscent (
    style : FontStyle
) : int

パラメータ

style

フォントのスタイル情報が格納されている FontStyle

戻り値

指定した FontStyle を使用するこの FontFamily のセル アセント。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

  • FontFamily を作成します。

  • そのフォント ファミリのセル アセントを取得します。

  • セル ディセントの値をテキストで画面に描画します。

Visual Basic
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
C#
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));
}
C++
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) );
   }
J#
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.get_Graphics().DrawString("ascentFontFamily.GetCellAscent() returns "
        + System.Convert.ToString(cellAscent) + ".", 
        new Font(ascentFontFamily, 16), 
        Brushes.get_Black(), new PointF(0, 0));
} //GetCellAscent_Example

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

.NET Framework

サポート対象 : 2.0、1.1、1.0
コミュニティ コンテンツ   コミュニティ コンテンツとは
新しいコンテンツの追加 RSS  注釈
Processing
© 2009 Microsoft Corporation. All rights reserved. 使用条件  |  商標  |  プライバシー
Page view tracker