hi edwin, can you please show your example by an added picture ?
don't understand fully your problem as I didn't have whole pb example at my hands

I was trying to paint my gradient with transparancy, something like a shadow.
1) you can use a second "drawGradient" function as shadow for first one and place it (for example)
for wx=15, hy=25 ?
my idea works fine:
SUB DrawGradient3 (BYVAL hwnd AS DWORD, BYVAL hdc AS DWORD)
LOCAL rc AS RECT
DIM vertex(1) AS TRIVERTEX
GetClientRect hwnd, rc
vertex(0).x = 15'0 -----------------> change here
vertex(0).y = 25'0 -----------------> change here
vertex(0).Red = &HFA00
vertex(0).Green = &HF900
vertex(0).Blue = &HF500
vertex(0).Alpha = &H0000
vertex(1).x = rc.nRight-20 - rc.nLeft '-----------------> -20! change here
vertex(1).y = rc.nBottom-20 - rc.nTop '-----------------> -20! change here
vertex(1).Red = &HC000
vertex(1).Green = &HC000
vertex(1).Blue = &HA800
vertex(1).Alpha = &H0000
LOCAL gRect AS GRADIENT_RECT
gRect.UpperLeft = 0
gRect.LowerRight = 1
GradientFill hDc, vertex(0), 2, gRect, 1, %GRADIENT_FILL_RECT_H
END SUB
2) perhaps ? ->try to use or do some experiments:
a) instead of
"Sub DrawGradient( ByVal hdc As Dword, ByVal R As RECT )"
take
"Sub DrawGradient( ByVal hdc As Dword )"
local R As RECT
use then
b) drawGradient hDc '--- >in your code below
c) don't understand this one in your example:
"hDC = GETDC( hWndc )"
d) sorry, I see I need more infos. What is your intention to build one gradient area with shadow and cover with some text ?
3) quite another idea: I would prefer to use "GDIPLUS.INC" with:
"GDIP_
ARGB_SetAlphaValue"
MiddleColorToOpaque = GDIP_ARGB_SetAlphaValue(%ARGB_MediumAquamarine, 0)
hStatus = GdipSetPathGradientCenterColor(pBrush1, MiddleColorToOpaque)
servus, best regards, frank