网站首页  词典首页

请输入您要查询的函数:

 

术语 gradientfill
释义 GradientFill
语法:
BOOL GradientFill(
__in HDC hdc,
__in PTRIVERTEX pVertex,
__in ULONG nVertex,
__in PVOID pMesh,
__in ULONG nMesh,
__in ULONG ulMode
);
渐变功能
该功能渐变填充矩形和三角形结构。
参数
hdc [in]
句柄到目标设备上下文。
pVertex [in]
一个一个TRIVERTEX结构数组的指针,每个定义一个顶点。
nVertex [in]
在pVertex顶点个数。
pMesh [in]
在一个三角形的模式,或者在矩形模式GRADIENT_RECT结构数组GRADIENT_TRIANGLE结构的数组。
nMesh [in]
元素的数量(三角形或矩形)在pMesh。
ulMode [in]
渐变填充的模式。此参数可以是下列值之一。
ValueMeaning
GRADIENT_FILL_RECT_HIn这种模式下,两个端点描述一个矩形。该矩形的定义有一个稳定的色彩(指明TRIVERTEX结构,左,右边缘)。 GDI的插值的颜色从左至右优势,填补了内地。
GRADIENT_FILL_RECT_VIn这种模式下,两个端点描述一个矩形。该矩形的定义有一个稳定的色彩(指明TRIVERTEX结构的顶部和底部边缘)。 GDI的插值从顶部向底部边缘的颜色和内部填充。
GRADIENT_FILL_TRIANGLEIn这种模式下,一个TRIVERTEX结构的数组被传递到GDI连同数组索引列表,描述不同三角形。 GDI执行之间的三角顶点和内部填充线性插值。绘制完成,直接在24 -和32 - bpp的模式。抖动是演出16 - ,8 - ,4 - ,和1 - bpp的模式。
返回值
如果函数成功,返回值为TRUE。
如果函数失败,返回值为FALSE。
备注
要添加阴影平滑的三角形,请三角形的三个端点渐变功能。 GDI的将线性插值并填写三角形。这里是一个阴影三角形图纸输出:

To add smooth shading to a rectangle, call GradientFill with the upper-left and lower-right coordinates of the rectangle.有画时使用矩形两种阴影模式。在横向模式下,矩形阴影左到右。在垂直模式下,该矩形阴影,从高端到低端。这里是两个阴影矩形图纸输出-在横向模式之一,在垂直模式其他:

该函数使用渐变网格方法指定的对象提请端点。所有被传递给顶点渐变的pVertex数组。在pMesh参数指定如何将这些顶点连接在一起,形成一个对象。当填充矩形,以一个GRADIENT_RECT结构的数组pMesh点。每个GRADIENT_RECT结构指定两个pVertex顶点数组的索引。这两个顶点形式左上角和低一个长方形的权利边界。
在填补一个三角形情况下,为了一个GRADIENT_TRIANGLE结构的数组pMesh点。每个GRADIENT_TRIANGLE结构指定了三个pVertex顶点数组的索引。这三个顶点组成一个三角形。
为了简化硬件加速,这个程序是无须像素在三角形内部完美。
请注意,不使用渐变的TRIVERTEX结构的阿尔法成员。要使用透明渐变,渐变调用,然后调用AlphaBlend为每个顶点Alpha通道所需的值。
有关更多信息,就能顺利底纹绘制阴影三角,矩形绘制阴影。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinGdi.h(头文件:winuser.h)
LibraryMsimg32.lib
DLLMsimg32.dll
参见
位图概述
位图功能
EMRGRADIENTFILL
GRADIENT_RECT
GRADIENT_TRIANGLE
TRIVERTEX
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GradientFill Function
The GradientFill function fills rectangle and triangle structures.
Syntax
BOOL GradientFill(
__in HDC hdc,
__in PTRIVERTEX pVertex,
__in ULONG nVertex,
__in PVOID pMesh,
__in ULONG nMesh,
__in ULONG ulMode
);
Parameters
hdc [in]
A handle to the destination device context.
pVertex [in]
A pointer to an array of TRIVERTEX structures that each define a vertex.
nVertex [in]
The number of vertices in pVertex.
pMesh [in]
An array of GRADIENT_TRIANGLE structures in triangle mode, or an array of GRADIENT_RECT structures in rectangle mode.
nMesh [in]
The number of elements (triangles or rectangles) in pMesh.
ulMode [in]
The gradient fill mode. This parameter can be one of the following values.
ValueMeaning
GRADIENT_FILL_RECT_HIn this mode, two endpoints describe a rectangle. The rectangle is defined to have a constant color (specified by the TRIVERTEX structure) for the left and right edges. GDI interpolates the color from the left to right edge and fills the interior.
GRADIENT_FILL_RECT_VIn this mode, two endpoints describe a rectangle. The rectangle is defined to have a constant color (specified by the TRIVERTEX structure) for the top and bottom edges. GDI interpolates the color from the top to bottom edge and fills the interior.
GRADIENT_FILL_TRIANGLEIn this mode, an array of TRIVERTEX structures is passed to GDI along with a list of array indexes that describe separate triangles. GDI performs linear interpolation between triangle vertices and fills the interior. Drawing is done directly in 24- and 32-bpp modes. Dithering is performed in 16-, 8-, 4-, and 1-bpp mode.

Return Value
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE.
Remarks
To add smooth shading to a triangle, call the GradientFill function with the three triangle endpoints. GDI will linearly interpolate and fill the triangle. Here is the drawing output of a shaded triangle:


To add smooth shading to a rectangle, call GradientFill with the upper-left and lower-right coordinates of the rectangle. There are two shading modes used when drawing a rectangle. In horizontal mode, the rectangle is shaded from left-to-right. In vertical mode, the rectangle is shaded from top-to-bottom. Here is the drawing output of two shaded rectangles - one in horizontal mode, the other in vertical mode:




The GradientFill function uses a mesh method to specify the endpoints of the object to draw. All vertices are passed to GradientFill in the pVertex array. The pMesh parameter specifies how these vertices are connected to form an object. When filling a rectangle, pMesh points to an array of GRADIENT_RECT structures. Each GRADIENT_RECT structure specifies the index of two vertices in the pVertex array. These two vertices form the upper-left and lower-right boundary of one rectangle.
In the case of filling a triangle, pMesh points to an array of GRADIENT_TRIANGLE structures. Each GRADIENT_TRIANGLE structure specifies the index of three vertices in the pVertex array. These three vertices form one triangle.
To simplify hardware acceleration, this routine is not required to be pixel-perfect in the triangle interior.
Note that GradientFill does not use the Alpha member of the TRIVERTEX structure. To use GradientFill with transparency, call GradientFill and then call AlphaBlend with the desired values for the alpha channel of each vertex.
For more information, see Smooth Shading , Drawing a Shaded Triangle , and Drawing a Shaded Rectangle .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinGdi.h (include Windows.h)
LibraryMsimg32.lib
DLLMsimg32.dll
See Also
Bitmaps Overview
Bitmap Functions
EMRGRADIENTFILL
GRADIENT_RECT
GRADIENT_TRIANGLE
TRIVERTEX
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144957(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:17:27