GraphicsPath.AddRectangle Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přidá do této cesty obdélník.
Přetížení
| Name | Description |
|---|---|
| AddRectangle(RectangleF) |
Přidá do této cesty obdélník. |
| AddRectangle(Rectangle) |
Přidá do této cesty obdélník. |
AddRectangle(RectangleF)
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
Přidá do této cesty obdélník.
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)
Parametry
- rect
- RectangleF
A RectangleF , který představuje obdélník, který chcete přidat.
Příklady
Pro příklad viz AddRectangle(Rectangle).
Platí pro
AddRectangle(Rectangle)
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
- Zdroj:
- GraphicsPath.cs
Přidá do této cesty obdélník.
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)
Parametry
Příklady
Následující příklad kódu je určený pro použití s model Windows Forms a vyžaduje PaintEventArgse, objekt události OnPaint. Kód provede následující akce:
Vytvoří cestu.
Vytvoří obdélník a přidá obdélník do cesty.
Nakreslí cestu na obrazovku.
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