Graphics.FillPath(Brush, GraphicsPath) Método
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Preenche o interior de um GraphicsPath.
public:
void FillPath(System::Drawing::Brush ^ brush, System::Drawing::Drawing2D::GraphicsPath ^ path);
public void FillPath(System.Drawing.Brush brush, System.Drawing.Drawing2D.GraphicsPath path);
member this.FillPath : System.Drawing.Brush * System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub FillPath (brush As Brush, path As GraphicsPath)
- path
- GraphicsPath
GraphicsPath que representa o caminho a ser preenchido.
O exemplo de código a seguir foi projetado para uso com o Windows Forms e requer PaintEventArgse
, que é um parâmetro do manipulador de eventos Paint. O código executa as seguintes ações:
Cria um pincel vermelho sólido.
Cria um objeto de caminho gráfico.
Adiciona uma reticência ao caminho gráfico.
Preenche o caminho na tela.
public:
void FillPathEllipse( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );
// Create graphics path object and add ellipse.
GraphicsPath^ graphPath = gcnew GraphicsPath;
graphPath->AddEllipse( 0, 0, 200, 100 );
// Fill graphics path to screen.
e->Graphics->FillPath( redBrush, graphPath );
}
public void FillPathEllipse(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create graphics path object and add ellipse.
GraphicsPath graphPath = new GraphicsPath();
graphPath.AddEllipse(0, 0, 200, 100);
// Fill graphics path to screen.
e.Graphics.FillPath(redBrush, graphPath);
}
Public Sub FillPathEllipse(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create graphics path object and add ellipse.
Dim graphPath As New GraphicsPath
graphPath.AddEllipse(0, 0, 200, 100)
' Fill graphics path to screen.
e.Graphics.FillPath(redBrush, graphPath)
End Sub
Um GraphicsPath consiste em uma série de segmentos de linha e curva. Se o caminho representado pelo parâmetro path
não for fechado, um segmento adicional será adicionado do último ponto ao primeiro ponto para fechar o caminho.
Produto | Versões |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.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 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: