Graphics.PageUnit Graphics.PageUnit Graphics.PageUnit Graphics.PageUnit Property

정의

Graphics의 페이지 좌표에 사용되는 측정 단위를 가져오거나 설정합니다.Gets or sets the unit of measure used for page coordinates in this Graphics.

public:
 property System::Drawing::GraphicsUnit PageUnit { System::Drawing::GraphicsUnit get(); void set(System::Drawing::GraphicsUnit value); };
public System.Drawing.GraphicsUnit PageUnit { get; set; }
member this.PageUnit : System.Drawing.GraphicsUnit with get, set
Public Property PageUnit As GraphicsUnit

속성 값

World를 제외한 GraphicsUnit 값 중 하나입니다.One of the GraphicsUnit values other than World.

예외

PageUnit는 물리적 단위가 아닌 World로 설정됩니다.PageUnit is set to World, which is not a physical unit.

예제

다음 코드 예제에서는 변경의 효과 보여 줍니다.는 PageUnit 속성입니다.The following code example demonstrates the effect of changing the PageUnit property.

이 예제에서는 Windows Forms를 사용 하 여 사용 하도록 설계 되었습니다.This example is designed to be used with Windows Forms. 양식과 호출 코드를 붙여 합니다 ChangePageUnit 폼을 처리 하는 경우 메서드 Paint 이벤트를 전달 e 으로 PaintEventArgs합니다.Paste the code into a form and call the ChangePageUnit method when handling the form's Paint event, passing e as PaintEventArgs.

private:
   void ChangePageUnit( PaintEventArgs^ e )
   {
      // Create a rectangle.
      Rectangle rectangle1 = Rectangle(20,20,50,100);

      // Draw its outline.
      e->Graphics->DrawRectangle( Pens::SlateBlue, rectangle1 );

      // Change the page scale.  
      e->Graphics->PageUnit = GraphicsUnit::Point;

      // Draw the rectangle again.
      e->Graphics->DrawRectangle( Pens::Tomato, rectangle1 );
   }
private void ChangePageUnit(PaintEventArgs e)
{

    // Create a rectangle.
    Rectangle rectangle1 = new Rectangle(20, 20, 50, 100);

    // Draw its outline.
    e.Graphics.DrawRectangle(Pens.SlateBlue, rectangle1);

    // Change the page scale.  
    e.Graphics.PageUnit = GraphicsUnit.Point;

    // Draw the rectangle again.
    e.Graphics.DrawRectangle(Pens.Tomato, rectangle1);

}
Private Sub ChangePageUnit(ByVal e As PaintEventArgs)

    ' Create a rectangle.
    Dim rectangle1 As New Rectangle(20, 20, 50, 100)

    ' Draw its outline.
    e.Graphics.DrawRectangle(Pens.SlateBlue, rectangle1)

    ' Change the page scale.  
    e.Graphics.PageUnit = GraphicsUnit.Point

    ' Draw the rectangle again.
    e.Graphics.DrawRectangle(Pens.Tomato, rectangle1)

End Sub

설명

그래픽 장치는이 페이지 좌표에 사용 되는 측정 단위 Graphics합니다.The graphics unit is the unit of measure used for page coordinates in this Graphics.

적용 대상

추가 정보