Método PathGradientBrush::SetCenterPoint(constPointF&) (gdipluspath.h)

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

Sintaxe

Status SetCenterPoint(
  const PointF & point
);

Parâmetros

point

Referência a um objeto PointF que especifica o ponto central.

Retornar valor

Type: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

Exemplos

O exemplo a seguir cria um objeto PathGradientBrush com base em uma elipse. O código define a cor central como azul e define a cor ao longo do limite como aqua. Por padrão, o ponto central estaria no centro da elipse (100, 50), mas a chamada para o método PathGradientBrush::SetCenterPoint define o ponto central como (180,5, 50,0).

VOID Example_SetCenter(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 center point.
   pthGrBrush.SetCenterPoint(PointF(180.5f, 50.0f));

   // 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);

   graphics.FillRectangle(&pthGrBrush, 0, 0, 300, 300);
}

Requisitos

Requisito Valor
Cabeçalho gdipluspath.h

Confira também

Pincéis e formas preenchidas

Criando um Gradiente de Caminho

Preenchendo uma forma com um Gradiente de Cor

Graphicspath

Pathgradientbrush

PathGradientBrush::GetCenterColor

Métodos PathGradientBrush::GetCenterPoint

PathGradientBrush::SetCenterColor