Trying to use GradientFill to paint a picturebox with a gradient from left to right, but it all comes up black.

Code:
VB Code:
  1. Public Sub PaintMe( _
  2.     ByVal x As Long, _
  3.     ByVal y As Long, _
  4.     Optional ByVal pfForceRepaint As Boolean = False _
  5. )
  6. '...
  7. Dim lStartColour        As Long
  8. Dim lEndColour          As Long
  9. Dim tvxVertices(1)      As TRIVERTEX
  10. Dim udtGradRect         As GRADIENT_RECT
  11.  
  12.     ' ...
  13.  
  14.         ' paint the background gradient
  15.         lStartColour = GradientColorStart
  16.         lEndColour = GradientColorEnd
  17.  
  18.         RGBToTriplex lStartColour, VarPtr(tvxVertices(0).Red), 2
  19.  
  20.         With tvxVertices(1)
  21.             RGBToTriplex lEndColour, VarPtr(.Red), 2
  22.  
  23.             .x = picBkgd.ScaleWidth
  24.             .y = picBkgd.ScaleHeight
  25.         End With
  26.  
  27.         udtGradRect.LowerRight = 1
  28.  
  29.         GradientFill picBkgd.hDC, _
  30.                      tvxVertices(0), _
  31.                      2, _
  32.                      udtGradRect, _
  33.                      1, _
  34.                      menmGradientDirection
  35.  
  36.     ' ...
  37.  
  38. End Sub

In case you're wondering (and this bit works):
VB Code:
  1. Sub RGBToTriplex( _
  2.     ByVal lRGB As Long, _
  3.     ByVal lOutAddress As Long, _
  4.     ByVal cbComponentSize As Long _
  5. )
  6.     RtlMoveMemory ByVal lOutAddress, ByVal VarPtr(lRGB), 1
  7.     RtlMoveMemory ByVal lOutAddress + cbComponentSize, ByVal VarPtr(lRGB) + 1, 1
  8.     RtlMoveMemory ByVal lOutAddress + 2 * cbComponentSize, ByVal VarPtr(lRGB) + 2, 1
  9. End Sub

The snipped sections are unrelated to the drawing itself.

Anyone spot anything from the API call that I've missed?