FontFamily.GetHashCode 메서드

정의

FontFamily의 해시 코드를 가져옵니다.

public:
 override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer

반환

FontFamily에 대한 해시 코드입니다.

예제

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

  • FontFamily을 만듭니다.

  • 글꼴 패밀리의 해시 코드를 가져옵니다.

  • 해시 코드의 값을 텍스트로 화면에 그립니다.

public:
   void GetHashCode_Example( PaintEventArgs^ e )
   {
      // Create a FontFamily object.
      FontFamily^ myFontFamily = gcnew FontFamily( "Arial" );

      // Get the hash code for myFontFamily.
      int hashCode = myFontFamily->GetHashCode();

      // Draw the value of hashCode to the screen as a string.
      e->Graphics->DrawString( String::Format( "hashCode = {0}", hashCode ),
            gcnew System::Drawing::Font( myFontFamily,16 ), Brushes::Black, PointF(0,0) );
   }
public void GetHashCode_Example(PaintEventArgs e)
{
    // Create a FontFamily object.
    FontFamily myFontFamily = new FontFamily("Arial");
             
    // Get the hash code for myFontFamily.
    int hashCode = myFontFamily.GetHashCode();
             
    // Draw the value of hashCode to the screen as a string.
    e.Graphics.DrawString(
        "hashCode = " + hashCode.ToString(),
        new Font(myFontFamily, 16),
        Brushes.Black,
        new PointF(0, 0));
}
Public Sub GetHashCode_Example(ByVal e As PaintEventArgs)

    ' Create a FontFamily object.
    Dim myFontFamily As New FontFamily("Arial")

    ' Get the hash code for myFontFamily.
    Dim hashCode As Integer = myFontFamily.GetHashCode()

    ' Draw the value of hashCode to the screen as a string.
    e.Graphics.DrawString("hashCode = " & hashCode.ToString(), _
    New Font(myFontFamily, 16), Brushes.Black, New PointF(0, 0))
End Sub

적용 대상