PathGradientBrush::SetBlendBellShape-Methode (gdipluspath.h)

Die PathGradientBrush::SetBlendBellShape-Methode legt die Mischform dieses Pfadverlaufspinsels fest.

Syntax

Status SetBlendBellShape(
  [in]           REAL focus,
  [in, optional] REAL scale
);

Parameter

[in] focus

Typ: REAL

Reelle Zahl, die angibt, wo die mittlere Farbe die höchste Intensität aufweist. Diese Zahl muss im Bereich von 0 bis 1 liegen.

[in, optional] scale

Typ: REAL

Optional. Reelle Zahl, die die maximale Intensität der mittleren Farbe angibt, die mit der Begrenzungsfarbe gemischt wird. Diese Zahl muss im Bereich von 0 bis 1 liegen. Der Standardwert ist 1.

Rückgabewert

Typ: Status

Wenn die Methode erfolgreich ist, gibt sie OK zurück, ein Element der Status-Enumeration .

Wenn die Methode fehlschlägt, gibt sie eines der anderen Elemente der Status-Enumeration zurück.

Hinweise

Wenn Sie von der Begrenzung eines Pfadverlaufs zum Mittelpunkt wechseln, ändert sich die Farbe standardmäßig schrittweise von der Begrenzungsfarbe zur mittleren Farbe. Sie können die Positionierung und Das Mischen der Begrenzungs- und Mittelfarben anpassen, indem Sie die PathGradientBrush::SetBlendBellShape-Methode aufrufen.

Beispiele

Im folgenden Beispiel wird ein PathGradientBrush-Objekt basierend auf einer Ellipse erstellt. Der Code ruft die PathGradientBrush::SetBlendBellShape-Methode des PathGradientBrush-Objekts auf, wobei ein Fokus von 0,2 und eine Skalierung von 0,7 übergeben wird. Anschließend verwendet der Code den Pfadverlaufspinsel, um ein Rechteck zu zeichnen, das die Ellipse enthält.

VOID Example_SetBlendShape(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 red.
   pthGrBrush.SetCenterColor(Color(255, 255, 0, 0));

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

   pthGrBrush.SetBlendBellShape(0.2f, 0.7f);

   // The color is blue on the boundary and at the center.
   // At points that are 20 percent of the way from the boundary to the
   // center, the color is 70 percent red and 30 percent blue.

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

Anforderungen

Anforderung Wert
Unterstützte Mindestversion (Client) Windows XP, Windows 2000 Professional [nur Desktop-Apps]
Unterstützte Mindestversion (Server) Windows 2000 Server [nur Desktop-Apps]
Zielplattform Windows
Kopfzeile gdipluspath.h (include Gdiplus.h)
Bibliothek Gdiplus.lib
DLL Gdiplus.dll

Weitere Informationen

Pinsel und gefüllte Formen

Farbe

Erstellen eines Pfadverlaufs

Füllen einer Form mit einem Farbverlauf

Graphicspath

Pathgradientbrush

PathGradientBrush::GetBlend

PathGradientBrush::GetBlendCount

PathGradientBrush::SetBlend

PathGradientBrush::SetBlendTriangularShape