Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2003.09.01;
Скачать: [xml.tar.bz2];

Вниз

Помогите разобраться с API-функцией GradientFill   Найти похожие ветки 

 
Dimaxx   (2003-06-28 19:17) [0]

Сабж... Определение есть в модуле windows. Как пользоваться, как вызывать... В хелпе нет описания.


 
Vladimir Kladov   (2003-06-28 20:29) [1]

Как же нет, есть.

GradientFill Method

See also Example
-------------------
Applies to

TCanvas

Declaration

procedure GradientFill(Canvas: TCanvas; Const Rect: TRect; top, bottom: TColor; Horizontal: Boolean);

Description

The GradientFill method is used to fill a Screen area with multi-colored lines to obtain a nice shadow effect and coloured backgrounds. The Chart.Gradient component uses this method internally. Chart.pas must be in your uses clause.


 
Dimaxx   (2003-06-28 23:50) [2]

В windows.pas описание другое. Это api-функция, а не часть модуля chart.pas. Вот api мне-то и нужно...


 
Vladimir Kladov   (2003-06-29 08:15) [3]

Действительно, видимо ошиблись. Заголовок как бы от метода TCanvas (а такого нет), а описание к TChart.

В msdn это есть. Но эта функция не для всех версий windows.

GradientFill
The GradientFill function fills rectangle and triangle structures.

BOOL GradientFill(
HDC hdc, // handle to DC
PTRIVERTEX pVertex, // array of vertices
ULONG dwNumVertex, // number of vertices
PVOID pMesh, // array of gradients
ULONG dwNumMesh, // size of gradient array
ULONG dwMode ( triangles or rectangles) Действительно, видимо ошиблись. Заголовок как бы от метода TCanvas (а такого нет), а описание к TChart.

В msdn это есть. Но эта функция не для всех версий windows.

GradientFill
The GradientFill function fills rectangle and triangle structures.

BOOL GradientFill(
HDC hdc, // handle to DC
PTRIVERTEX pVertex, // array of vertices
ULONG dwNumVertex, // number of vertices
PVOID pMesh, // array of gradients
ULONG dwNumMesh, // size of gradient array
ULONG dwMode // gradient fill mode
);
Parameters
hdc
[in] Handle to the destination device context.
pVertex
[in] Pointer to an array of TRIVERTEX structures that each define a triangle vertex.
dwNumVertex
[in] The number of vertices in pVertex.
pMesh
[in] Array of GRADIENT_TRIANGLE structures in triangle mode, or an array of GRADIENT_RECT structures in rectangle mode.
dwNumMesh
[in] The number of elements (triangles or rectangles) in pMesh.
dwMode
[in] Specifies gradient fill mode. This parameter can be one of the following values. Value Meaning
GRADIENT_FILL_RECT_H In 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 top to bottom edge and fills the interior.
GRADIENT_FILL_RECT_V In 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_TRIANGLE In 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 Values
If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE.

Windows NT/ 2000: To get extended error information, call GetLastError.

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.

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.

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.

In order to simplify hardware acceleration, this routine is not required to be pixel-perfect in the triangle interior.

For more information, see Smooth Shading, Drawing a Shaded Triangle, and Drawing a Shaded Rectangle.

Requirements
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 98.
Header: Declared in Wingdi.h; include Windows.h.
Library: Included as a resource in Msimg32.dll.

See Also
Bitmaps Overview, Bitmap Functions, EMRGRADIENTFILL, GRADIENT_RECT, GRADIENT_TRIANGLE, TRIVERTEX



 
MBo   (2003-06-29 12:48) [4]

в winsows.pas есть ошибка, так что см. пример
http://delphimaster.net/view/1-1056691287/



Страницы: 1 вся ветка

Форум: "WinAPI";
Текущий архив: 2003.09.01;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.48 MB
Время: 0.009 c
1-1363
Fog
2003-08-19 17:00
2003.09.01
EListError при обращении к TToolBar.Buttons


14-1550
Ketmar
2003-08-12 10:59
2003.09.01
телевизор рулит!


1-1393
AZ
2003-08-16 09:09
2003.09.01
EOF для СОМ-порта


1-1454
Still_Swamp
2003-08-19 17:14
2003.09.01
Прочитать в TMemoryStream


3-1283
edit_box
2003-07-18 11:04
2003.09.01
Как из БД засунуть информацию в Excel 2000.





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский