Visual Basic 6 Black Book:Picture Boxes And Image Controls
Here are the arguments you pass to Circle():
• Step—Keyword specifying that the center of the circle, ellipse, or arc is relative to the current
coordinates given by the CurrentX and CurrentY properties of object.
• x, y—Single values indicating the coordinates for the center point of the circle, ellipse, or arc.
The ScaleMode property of object determines the units of measure used.
• radius—Single value indicating the radius of the circle, ellipse, or arc. The ScaleMode
property of object determines the unit of measure used.
• color—Long integer value indicating the RGB color of the circle’s outline. If omitted, the
value of the ForeColor property is used. You can use the RGB function or QBColor function to
specify the color.
• start, end—Single-precision values. When an arc or a partial circle or ellipse is drawn, start
and end specify (in radians) the beginning and end positions of the arc. The range for both is –2
pi radians to 2 pi radians. The default value for start is 0 radians; the default for end is 2 * pi
• aspect—Single-precision value indicating the aspect ratio of the circle. The default value is 1.0,
which yields a perfect (nonelliptical) circle on any screen.
As an example, we draw a circle in a picture box with this code:
Private Sub Command1_Click()
Picture1.Circle (80, 70), 50
The result of this code appears in Figure 10.9. If there were an image already in the picture box, the
circle would appear drawn on top of it.
Figure 10.9 Drawing a circle in a picture box.
You use the Line() method to draw lines:
PictureBox.Line [Step] ( x1, y 1) [Step] ( x2, y2), [ color], [B][F]
Here are the arguments you pass to Line():
• Step—Keyword specifying that the starting point coordinates are relative to the current
graphics position given by the CurrentX and CurrentY properties.
• x1, y1—Single values indicating the coordinates of the starting point for the line or rectangle.
The ScaleMode property determines the unit of measure used. If omitted, the line begins at the
position indicated by CurrentX and CurrentY.
• Step—Keyword specifying that the end-point coordinates are relative to the line starting point.
• x2, y2—Single values indicating the coordinates of the end point for the line being drawn.
• color—Long integer value indicating the RGB color used to draw the line. If omitted, the
ForeColor property setting is used. You can use the RGB function or QBColor function to
specify the color.
• B—If included, causes a box to be drawn using the coordinates to specify opposite corners of
• F—If the B option is used, the F option specifies that the box is filled with the same color used
file:///E|/Program%20Files/KaZaA/My%20Shared%...Basic%20-%20%20Black%20Book/ch10/323-326.html (2 of 3) [7/31/2001 8:59:19 AM]