Tip : fast arc drawing

I have an app where I needed to draw 90deg arcs based on an enclosed rectangle (like DrawOval except only a 1/4 of the oval)
so here is a code snippet that will do exactly that

Private Sub drawArc(g as graphics,x as integer,y as integer,w as integer,h as integer,direction as integer)
  Dim clr As String
  Dim wid As Integer
  Dim gClip As graphics
  gClip=g.Clip(x,y,w,h)
  //
  w=w*2
  h=h*2
  //
  Select Case direction
  Case 0
    x=0
    y=0
  Case 1
    x=-w/2
    y=0
  Case 2
    x=0
    y=-h/2
  Case Else
    x=-w/2
    y=-h/2
  End Select
  //
  gClip.ForeColor=g.forecolor
  gClip.PenWidth=g.penwidth
  gClip.drawoval x,y,w,h

  
End Sub