Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than gdi32, prefix the name with the module name and a period.
GradientFill (gdi32)
.
For strongest red or/and green or/and blue or/and alpha, use ushort.MaxValue. For white color, set all R, G and B to ushort.MaxValue!
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
C# Signature:
[DllImport("gdi32.dll", EntryPoint = "GdiGradientFill", ExactSpelling = true)]
public static extern bool GradientFill(
IntPtr hdc, // handle to DC
TRIVERTEX[] pVertex, // array of vertices
uint dwNumVertex, // number of vertices
GRADIENT_RECT[] pMesh, // array of gradient rectangles, that each one keeps two indices in pVertex array, to determine its bounds
uint dwNumMesh, // number of gradient rectangles to draw
GRADIENT_FILL dwMode); // Use either GRADIENT_FILL.RECT_H or GRADIENT_FILL.RECT_V. Using the value GRADIENT_FILL.TRIANGLE is wrong in this overload!
C# Signature:
[DllImport("gdi32.dll", EntryPoint = "GdiGradientFill", ExactSpelling = true)]
public static extern bool GradientFill(
IntPtr hdc, // handle to DC
TRIVERTEX[] pVertex, // array of vertices
uint dwNumVertex, // number of vertices
GRADIENT_TRIANGLE[] pMesh, // array of gradient triangles, that each one keeps three indices in pVertex array, to determine its bounds
uint dwNumMesh, // number of gradient triangles to draw
GRADIENT_FILL dwMode); // Use only GRADIENT_FILL.TRIANGLE. Both values GRADIENT_FILL.RECT_H and GRADIENT_FILL.RECT_V are wrong in this overload!
VB Signature:
Declare Function GradientFill Lib "gdi32.dll" (TODO) As TODO
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:
TODO - a short description
9/7/2021 12:31:58 AM - tmo793-180.150.94.207
Performs GDI32 based gradient fills of rectangles and triangles
8/21/2014 6:06:57 PM - -84.229.91.166
TODO - a short description
9/7/2021 12:31:58 AM - tmo793-180.150.94.207
TODO - a short description
9/7/2021 12:31:58 AM - tmo793-180.150.94.207
Used in the [GradientFill] function
8/21/2014 7:23:03 AM - -50.241.168.105
A structure used by the [GradientFill] function
8/21/2014 7:13:26 PM - -50.241.168.105
Structure used by the [GradientFill] function
8/21/2014 7:12:25 PM - -84.229.91.166
Used with [GradientFill]
7/9/2014 8:46:41 AM - anonymous
TODO - a short description
9/7/2021 12:31:58 AM - tmo793-180.150.94.207
TODO - a short description
3/16/2007 7:31:57 AM - anfortas.geo@yahoo.com-216.204.61.86
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).