GraphicsPath.Widen Método
Definição
Substitui este caminho por curvas que circunscrevem a área preenchida quando esse caminho é desenhado pela caneta especificada.Replaces this path with curves that enclose the area that is filled when this path is drawn by the specified pen.
Sobrecargas
| Widen(Pen) |
Adiciona um contorno adicional ao caminho.Adds an additional outline to the path. |
| Widen(Pen, Matrix) |
Adiciona um contorno adicional ao GraphicsPath.Adds an additional outline to the GraphicsPath. |
| Widen(Pen, Matrix, Single) |
Substitui este GraphicsPath por curvas que circunscrevem a área preenchida quando esse caminho é desenhado pela caneta especificada.Replaces this GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen. |
Widen(Pen)
Adiciona um contorno adicional ao caminho.Adds an additional outline to the path.
public:
void Widen(System::Drawing::Pen ^ pen);
public void Widen (System.Drawing.Pen pen);
member this.Widen : System.Drawing.Pen -> unit
Public Sub Widen (pen As Pen)
Parâmetros
- pen
- Pen
Um Pen que especifica a largura entre a estrutura de tópicos original do caminho e a nova estrutura de tópicos criada por esse método.A Pen that specifies the width between the original outline of the path and the new outline this method creates.
Exemplos
Para ver um exemplo, consulte Widen(Pen, Matrix, Single).For an example, see Widen(Pen, Matrix, Single).
Comentários
Esse método cria uma estrutura de tópicos em torno das linhas originais GraphicsPath , com uma distância entre as linhas existentes e a nova estrutura de tópicos igual à da largura do Pen usada na chamada para Widen .This method creates an outline around the original lines in this GraphicsPath, with a distance between the existing lines and the new outline equal to that of the width of the Pen used in the call to Widen. Se você quiser preencher o espaço entre as linhas, você deve usar o em FillPath vez disso DrawPath .If you want to fill the space between the lines you must use the FillPath rather then the DrawPath.
Aplica-se a
Widen(Pen, Matrix)
Adiciona um contorno adicional ao GraphicsPath.Adds an additional outline to the GraphicsPath.
public:
void Widen(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::Matrix ^ matrix);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix? matrix);
member this.Widen : System.Drawing.Pen * System.Drawing.Drawing2D.Matrix -> unit
Public Sub Widen (pen As Pen, matrix As Matrix)
Parâmetros
- pen
- Pen
Um Pen que especifica a largura entre a estrutura de tópicos original do caminho e a nova estrutura de tópicos criada por esse método.A Pen that specifies the width between the original outline of the path and the new outline this method creates.
- matrix
- Matrix
Um Matrix que especifica uma transformação a ser aplicada ao caminho antes da ampliação.A Matrix that specifies a transform to apply to the path before widening.
Exemplos
Para ver um exemplo, consulte Widen(Pen, Matrix, Single).For an example, see Widen(Pen, Matrix, Single).
Comentários
Esse método cria uma estrutura de tópicos em torno das linhas originais GraphicsPath , com uma distância entre as linhas existentes e a nova estrutura de tópicos igual à da largura do Pen usada na chamada para Widen .This method creates an outline around the original lines in this GraphicsPath, with a distance between the existing lines and the new outline equal to that of the width of the Pen used in the call to Widen. Se você quiser preencher o espaço entre as linhas, você deve usar o em FillPath vez disso DrawPath .If you want to fill the space between the lines you must use the FillPath rather then the DrawPath.
Aplica-se a
Widen(Pen, Matrix, Single)
Substitui este GraphicsPath por curvas que circunscrevem a área preenchida quando esse caminho é desenhado pela caneta especificada.Replaces this GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen.
public:
void Widen(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::Matrix ^ matrix, float flatness);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix, float flatness);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix? matrix, float flatness);
member this.Widen : System.Drawing.Pen * System.Drawing.Drawing2D.Matrix * single -> unit
Public Sub Widen (pen As Pen, matrix As Matrix, flatness As Single)
Parâmetros
- pen
- Pen
Um Pen que especifica a largura entre a estrutura de tópicos original do caminho e a nova estrutura de tópicos criada por esse método.A Pen that specifies the width between the original outline of the path and the new outline this method creates.
- matrix
- Matrix
Um Matrix que especifica uma transformação a ser aplicada ao caminho antes da ampliação.A Matrix that specifies a transform to apply to the path before widening.
- flatness
- Single
Um valor que especifica a planeza das curvas.A value that specifies the flatness for curves.
Exemplos
O exemplo de código a seguir foi projetado para uso com Windows Forms, e ele requer PaintEventArgs e um OnPaint objeto de evento.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, an OnPaint event object. O código executa as seguintes ações:The code performs the following actions:
Cria um caminho e adiciona duas reticências ao caminho.Creates a path and adds two ellipses to the path.
Desenha o caminho em preto.Draws the path in black.
Amplia o caminho.Widens the path.
Desenha o caminho em vermelho.Draws the path in red.
Observe que a segunda renderização usa FillPath em vez de e DrawPath , portanto, a figura renderizada tem a estrutura de tópicos preenchida.Notice that the second rendering uses FillPath instead of DrawPath, and hence the rendered figure has the outline filled.
private:
void WidenExample( PaintEventArgs^ e )
{
// Create a path and add two ellipses.
GraphicsPath^ myPath = gcnew GraphicsPath;
myPath->AddEllipse( 0, 0, 100, 100 );
myPath->AddEllipse( 100, 0, 100, 100 );
// Draw the original ellipses to the screen in black.
e->Graphics->DrawPath( Pens::Black, myPath );
// Widen the path.
Pen^ widenPen = gcnew Pen( Color::Black,10.0f );
Matrix^ widenMatrix = gcnew Matrix;
widenMatrix->Translate( 50, 50 );
myPath->Widen( widenPen, widenMatrix, 1.0f );
// Draw the widened path to the screen in red.
e->Graphics->FillPath( gcnew SolidBrush( Color::Red ), myPath );
}
private void WidenExample(PaintEventArgs e)
{
// Create a path and add two ellipses.
GraphicsPath myPath = new GraphicsPath();
myPath.AddEllipse(0, 0, 100, 100);
myPath.AddEllipse(100, 0, 100, 100);
// Draw the original ellipses to the screen in black.
e.Graphics.DrawPath(Pens.Black, myPath);
// Widen the path.
Pen widenPen = new Pen(Color.Black, 10);
Matrix widenMatrix = new Matrix();
widenMatrix.Translate(50, 50);
myPath.Widen(widenPen, widenMatrix, 1.0f);
// Draw the widened path to the screen in red.
e.Graphics.FillPath(new SolidBrush(Color.Red), myPath);
}
Public Sub WidenExample(ByVal e As PaintEventArgs)
Dim myPath As New GraphicsPath
myPath.AddEllipse(0, 0, 100, 100)
myPath.AddEllipse(100, 0, 100, 100)
e.Graphics.DrawPath(Pens.Black, myPath)
Dim widenPen As New Pen(Color.Black, 10)
Dim widenMatrix As New Matrix
widenMatrix.Translate(50, 50)
myPath.Widen(widenPen, widenMatrix, 1.0F)
' Sets tension for curves.
e.Graphics.FillPath(New SolidBrush(Color.Red), myPath)
End Sub
Comentários
Esse método cria uma estrutura de tópicos em torno das linhas originais GraphicsPath , com uma distância entre as linhas existentes e a nova estrutura de tópicos igual à da largura do Pen usada na chamada para Widen .This method creates an outline around the original lines in this GraphicsPath, with a distance between the existing lines and the new outline equal to that of the width of the Pen used in the call to Widen. Se você quiser preencher o espaço entre as linhas, você deve usar o em FillPath vez disso DrawPath .If you want to fill the space between the lines you must use the FillPath rather then the DrawPath.