Método PathGradientBrush::GetCenterPoint(Point*) (gdipluspath.h)

O método PathGradientBrush::GetCenterPoint obtém o ponto central desse pincel de gradiente de caminho.

Sintaxe

Status GetCenterPoint(
  [out] Point *point
);

Parâmetros

[out] point

Tipo: Ponto*

Ponteiro para um objeto Point que recebe o ponto central.

Retornar valor

Tipo: Status

Se o método for bem-sucedido, ele retornará Ok, que é um elemento da enumeração Status .

Se o método falhar, ele retornará um dos outros elementos da enumeração Status .

Comentários

Por padrão, o ponto central de um objeto PathGradientBrush está no centroide do caminho de limite do pincel, mas você pode definir o ponto central como qualquer local, dentro ou fora do caminho, chamando o método SetCenterPoint do objeto PathGradientBrush .

Exemplos

O exemplo a seguir demonstra vários métodos da classe PathGradientBrush , incluindo PathGradientBrush::GetCenterPoint e PathGradientBrush::SetCenterColor. O código cria um objeto PathGradientBrush e define a cor central e a cor do limite do pincel. O código chama o método PathGradientBrush::GetCenterPoint para determinar o ponto central do pincel de gradiente de caminho e desenha uma linha da origem para esse ponto central.

VOID Example_GetCenterPoint(HDC hdc)
{
   Graphics graphics(hdc);

   // Create a path that consists of a single ellipse.
   GraphicsPath path;
   path.AddEllipse(0, 0, 200, 100);

   // Use the path to construct a brush.
   PathGradientBrush pthGrBrush(&path);

   // Set the color at the center of the path to blue.
   pthGrBrush.SetCenterColor(Color(255, 0, 0, 255));

   // Set the color along the entire boundary of the path to aqua.
   Color colors[] = {Color(255, 0, 255, 255)};
   INT count = 1;
   pthGrBrush.SetSurroundColors(colors, &count);

   // Fill the ellipse with the path gradient brush.
   graphics.FillEllipse(&pthGrBrush, 0, 0, 200, 100);

   // Obtain information about the path gradient brush.
   Point  centerPoint;
   pthGrBrush.GetCenterPoint(&centerPoint);

   // Draw a line from the origin to the center of the ellipse.
   Pen pen(Color(255, 0, 255, 0));
   graphics.DrawLine(&pen, Point(0, 0), centerPoint);
}

Requisitos

Requisito Valor
Cliente mínimo com suporte Windows XP, Windows 2000 Professional [somente aplicativos da área de trabalho]
Servidor mínimo com suporte Windows 2000 Server [somente aplicativos da área de trabalho]
Plataforma de Destino Windows
Cabeçalho gdipluspath.h (inclua Gdiplus.h)
Biblioteca Gdiplus.lib
DLL Gdiplus.dll

Confira também

Pincéis e formas preenchidas

Cor

Criando um Gradiente de Caminho

Preenchendo uma forma com um Gradiente de Cor

Pathgradientbrush

PathGradientBrush::GetCenterColor

PathGradientBrush::SetCenterColor

Métodos PathGradientBrush::SetCenterPoint