GraphicsPath.AddRectangle Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Adiciona um retângulo a este caminho.
Sobrecargas
| Name | Description |
|---|---|
| AddRectangle(RectangleF) |
Adiciona um retângulo a este caminho. |
| AddRectangle(Rectangle) |
Adiciona um retângulo a este caminho. |
AddRectangle(RectangleF)
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Adiciona um retângulo a este caminho.
public:
void AddRectangle(System::Drawing::RectangleF rect);
public void AddRectangle(System.Drawing.RectangleF rect);
member this.AddRectangle : System.Drawing.RectangleF -> unit
Public Sub AddRectangle (rect As RectangleF)
Parâmetros
- rect
- RectangleF
A RectangleF que representa o retângulo a adicionar.
Exemplos
Para obter um exemplo, consulte AddRectangle(Rectangle).
Aplica-se a
AddRectangle(Rectangle)
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Adiciona um retângulo a este caminho.
public:
void AddRectangle(System::Drawing::Rectangle rect);
public void AddRectangle(System.Drawing.Rectangle rect);
member this.AddRectangle : System.Drawing.Rectangle -> unit
Public Sub AddRectangle (rect As Rectangle)
Parâmetros
Exemplos
O seguinte exemplo de código foi concebido para uso com Windows Forms e requer PaintEventArgse, um objeto de evento OnPaint. O código executa as seguintes ações:
Cria um caminho.
Cria um retângulo e adiciona o retângulo ao caminho.
Desenha o caminho até ao ecrã.
private:
void AddRectangleExample( PaintEventArgs^ e )
{
// Create a GraphicsPath object and add a rectangle to it.
GraphicsPath^ myPath = gcnew GraphicsPath;
Rectangle pathRect = Rectangle(20,20,100,200);
myPath->AddRectangle( pathRect );
// Draw the path to the screen.
Pen^ myPen = gcnew Pen( Color::Black,2.0f );
e->Graphics->DrawPath( myPen, myPath );
}
private void AddRectangleExample(PaintEventArgs e)
{
// Create a GraphicsPath object and add a rectangle to it.
GraphicsPath myPath = new GraphicsPath();
Rectangle pathRect = new Rectangle(20, 20, 100, 200);
myPath.AddRectangle(pathRect);
// Draw the path to the screen.
Pen myPen = new Pen(Color.Black, 2);
e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddRectangleExample(ByVal e As PaintEventArgs)
' Create a GraphicsPath object and add a rectangle to it.
Dim myPath As New GraphicsPath
Dim pathRect As New Rectangle(20, 20, 100, 200)
myPath.AddRectangle(pathRect)
' Draw the path to the screen.
Dim myPen As New Pen(Color.Black, 2)
e.Graphics.DrawPath(myPen, myPath)
End Sub