GraphicsPath.Widen 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.
Substitui este caminho por curvas que cercam a área preenchida quando este caminho é desenhado pela caneta especificada.
Sobrecargas
| Name | Descrição |
|---|---|
| Widen(Pen, Matrix) |
Adiciona um esboço adicional ao GraphicsPath. |
| Widen(Pen) |
Adiciona um contorno adicional ao percurso. |
| Widen(Pen, Matrix, Single) |
Substitui isto GraphicsPath por curvas que delimitam a área preenchida quando este caminho é desenhado pela caneta especificada. |
Widen(Pen, Matrix)
- Origem:
- GraphicsPath.cs
- 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 esboço adicional ao 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
A que especifica a largura entre o contorno original do caminho e o novo contorno que Pen este método cria.
Exemplos
Para obter um exemplo, consulte Widen(Pen, Matrix, Single).
Observações
Este método cria um contorno em torno das linhas originais neste GraphicsPath, com uma distância entre as linhas existentes e o novo contorno igual à largura do Pen usado na chamada para Widen. Se quiser preencher o espaço entre as linhas, deve usar o FillPath em vez do DrawPath.
Aplica-se a
Widen(Pen)
- Origem:
- GraphicsPath.cs
- 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 contorno adicional ao percurso.
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
A que especifica a largura entre o contorno original do caminho e o novo contorno que Pen este método cria.
Exemplos
Para obter um exemplo, consulte Widen(Pen, Matrix, Single).
Observações
Este método cria um contorno em torno das linhas originais neste GraphicsPath, com uma distância entre as linhas existentes e o novo contorno igual à largura do Pen usado na chamada para Widen. Se quiser preencher o espaço entre as linhas, deve usar o FillPath em vez do DrawPath.
Aplica-se a
Widen(Pen, Matrix, Single)
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
- Origem:
- GraphicsPath.cs
Substitui isto GraphicsPath por curvas que delimitam a área preenchida quando este caminho é desenhado pela caneta especificada.
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
A que especifica a largura entre o contorno original do caminho e o novo contorno que Pen este método cria.
- flatness
- Single
Um valor que especifica a planitude para curvas.
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 e adiciona duas elipses ao caminho.
Desenha o caminho a preto.
Alarga o caminho.
Desenha o caminho a vermelho.
Note que a segunda renderização usa FillPath em vez de DrawPath, e por isso a figura renderizada tem o contorno preenchido.
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
Observações
Este método cria um contorno em torno das linhas originais neste GraphicsPath, com uma distância entre as linhas existentes e o novo contorno igual à largura do Pen usado na chamada para Widen. Se quiser preencher o espaço entre as linhas, deve usar o FillPath em vez do DrawPath.