GradientFill (gdi32)
Last changed: -84.229.91.166

.
Summary
Performs GDI32 based gradient fills of rectangles and triangles

C# Signature:

[DllImport("gdi32.dll", EntryPoint = "GdiGradientFill", ExactSpelling = true)]
public static extern bool GradientFill(
    IntPtr hdc,           // handle to DC
    IntPtr pVertex,    // array of vertices
    uint dwNumVertex,     // number of vertices
    IntPtr pMesh,           // array of gradients
    uint dwNumMesh,       // size of gradient array
    GRADIENT_FILL dwMode);           // gradient fill mode

VB Signature:

Declare Function GradientFill Lib "gdi32.dll" (TODO) As TODO

User-Defined Types:

TRIVERTEX

GRADIENT_RECT

GRADIENT_TRIANGLE

GRADIENT_FILL

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

The GDI32.dll does not contain a GradientFill() function. The actual entry point is GdiGradientFill(). That's why the 'EntryPoint' attribute is present.

This method creates one entry each for rectangles and triangles. It's just a matter of convenience and error checking by the compiler.

Tips & Tricks:

Please add some!

Sample Code:

Documentation