Graphics.PageUnit 속성
정의
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 .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.