Convert DrawPolygon to DrawPath

Hi-

Updating one of my apps and I can’t figure how to convert this code to use DrawPath -

for n = value DownTo 1
  if (n mod 2)>0 then
    x1(n)=(g.Height/1.2)+cos(n)*value
  Else
    x1(n) = (g.Width/3.4) +sin(n)*value
  end if
  
next

g.DrawingColor = Rgb(MasterColor.Red + Randy.InRange(-255,255),MasterColor.green + Randy.InRange(-255,255),MasterColor.blue + Randy.InRange(-255,255))
g.DrawPolygon x1

Thanks.

Here is some code from @Paul_Lefebvre:

dim thePath as new GraphicsPath
For i As Integer = 1 To xy.LastIndex Step 2
  Var x As Integer = xy(i) + g.PenSize / 2
  Var y As Integer = xy(i + 1) + g.PenSize / 2
  If i = 1 Then
    thePath.MoveToPoint(x, y)
  Else
    thePath.AddLineToPoint(x, y)
  End If
Next

Ah I see. Thanks.