Graphics.PageUnit Proprietà
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene o imposta l'unità di misura usata per le coordinate di pagina in questo oggetto 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
Uno dei valori di GraphicsUnit diverso da World.
Nell'esempio di codice seguente viene illustrato l'effetto della modifica della PageUnit proprietà .
Questo esempio è progettato per essere usato con Windows Forms. Incollare il codice in una maschera e chiamare il metodo quando si gestisce l'evento ChangePageUnit
del Paint modulo, passando e
come 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
L'unità grafica è l'unità di misura utilizzata per le coordinate di pagina in questo Graphicsoggetto .
Prodotto | Versioni |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: