Private Declare Function Ellipse Lib "gdi32" (ByVal hdc As _
Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As _
Long, ByVal Y2 As Long) As Long
Private Sub Form_Load()
Dim X As Single
Dim Y As Single
AutoRedraw = True
' API functions always draw in pixels.
ScaleMode = vbPixels
' Draw a background.
DrawWidth = 3
X = -ScaleHeight - 5
Y = -5
Do While X <= ScaleWidth
Line (X, Y)-Step(ScaleHeight + 10, ScaleHeight + _
10), vbRed
X = X + 20
Loop
' Draw a filled ellipse.
DrawWidth = 5
FillStyle = vbFSSolid
FillColor = vbYellow
Ellipse hdc, ScaleWidth * 0.1, ScaleHeight * 0.1, _
ScaleWidth * 0.45, ScaleHeight * 0.45
' Draw a hollow dotted ellipse.
DrawWidth = 1
FillStyle = vbFSTransparent
DrawStyle = vbDot
Ellipse hdc, ScaleWidth * 0.55, ScaleHeight * 0.55, _
ScaleWidth * 0.9, ScaleHeight * 0.9
End Sub
|