Size.Implicit(Size to SizeF) 연산자

정의

지정된 Size 구조체를 SizeF 구조체로 변환합니다.

public:
 static operator System::Drawing::SizeF(System::Drawing::Size p);
public static implicit operator System.Drawing.SizeF (System.Drawing.Size p);
static member op_Implicit : System.Drawing.Size -> System.Drawing.SizeF
Public Shared Widening Operator CType (p As Size) As SizeF

매개 변수

p
Size

변환할 Size 구조체입니다.

반환

이 연산자가 변환될 SizeF 구조체입니다.

예제

다음 코드 예제에서는 G, , BRA 속성을 보여 줍니다는 및 Color 멤버입니다Implicit.

이 예제는 Windows Form과 함께 사용하도록 설계되었습니다. 코드를 양식에 붙여넣고 양식의 Paint 이벤트 처리 메서드에서 메서드를 호출 ShowPropertiesOfSlateBlue 하여 로 PaintEventArgs전달 e 합니다.

void ShowPropertiesOfSlateBlue( PaintEventArgs^ e )
{
   Color slateBlue = Color::FromName( "SlateBlue" );
   Byte g = slateBlue.G;
   Byte b = slateBlue.B;
   Byte r = slateBlue.R;
   Byte a = slateBlue.A;
   array<Object^>^temp0 = {a,r,g,b};
   String^ text = String::Format( "Slate Blue has these ARGB values: Alpha:{0}, "
   "red:{1}, green: {2}, blue {3}", temp0 );
   e->Graphics->DrawString( text, gcnew System::Drawing::Font( this->Font,FontStyle::Italic ), gcnew SolidBrush( slateBlue ), RectangleF(PointF(0.0F,0.0F),this->Size) );
}
private void ShowPropertiesOfSlateBlue(PaintEventArgs e)
{
    Color slateBlue = Color.FromName("SlateBlue");
    byte g = slateBlue.G;
    byte b = slateBlue.B;
    byte r = slateBlue.R;
    byte a = slateBlue.A;
    string text = String.Format("Slate Blue has these ARGB values: Alpha:{0}, " +
        "red:{1}, green: {2}, blue {3}", new object[]{a, r, g, b});
    e.Graphics.DrawString(text, 
        new Font(this.Font, FontStyle.Italic), 
        new SolidBrush(slateBlue), 
        new RectangleF(new PointF(0.0F, 0.0F), this.Size));
}
Private Sub ShowPropertiesOfSlateBlue(ByVal e As PaintEventArgs)
    Dim slateBlue As Color = Color.FromName("SlateBlue")
    Dim g As Byte = slateBlue.G
    Dim b As Byte = slateBlue.B
    Dim r As Byte = slateBlue.R
    Dim a As Byte = slateBlue.A
    Dim text As String = _
    String.Format("Slate Blue has these ARGB values: Alpha:{0}, " _
       & "red:{1}, green: {2}, blue {3}", New Object() {a, r, g, b})
    e.Graphics.DrawString(text, New Font(Me.Font, FontStyle.Italic), _
        New SolidBrush(slateBlue), _
        New RectangleF(New PointF(0.0F, 0.0F), _
        Size.op_Implicit(Me.Size)))
End Sub

적용 대상