Printer.Circle Method (Boolean, Single, Single, Single, Int32, Single, Single, Single)

 

Prints a circle, an ellipse, or an arc on a page, specifying whether the center point is relative to the current location.

Namespace:   Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

public void Circle(
    bool relativeStart,
    float x,
    float y,
    float radius,
    int color = -1,
    float startAngle = NaNf,
    float endAngle = NaNf,
    float aspect = 1f
)
public:
void Circle(
    bool relativeStart,
    float x,
    float y,
    float radius,
    int color = -1,
    float startAngle = NaNf,
    float endAngle = NaNf,
    float aspect = 1f
)
member Circle : 
        relativeStart:bool *
        x:float32 *
        y:float32 *
        radius:float32 *
        color:int = -1 *
        startAngle:float32 = NaNf *
        endAngle:float32 = NaNf *
        aspect:float32 = 1f -> unit
Public Sub Circle (
    relativeStart As Boolean,
    x As Single,
    y As Single,
    radius As Single,
    color As Integer,
    startAngle As Single,
    endAngle As Single,
    aspect As Single
)

Parameters

  • relativeStart
    Type: System.Boolean

    Boolean. If this parameter is set to true, the center of the circle, ellipse, or arc is printed relative to the coordinates specified in the CurrentX and CurrentY properties of the object.

  • x
    Type: System.Single

    Single value indicating the vertical coordinate for the center point of the circle, ellipse, or arc. The ScaleMode property determines the units of measurement used.

  • y
    Type: System.Single

    Single value indicating the radius of the circle or ellipse. The ScaleMode property determines the units of measurement used.

  • radius
    Type: System.Single

    Single value indicating the radius of the circle or ellipse. The ScaleMode property determines the units of measurement used.

  • color
    Type: System.Int32

    Optional. Integer value indicating the RGB (red-green-blue) color of the circle's outline. If this parameter is omitted, the value of Black is used.

  • startAngle
    Type: System.Single

    Optional. Single-precision value. When an arc or a partial circle or ellipse is printed, startangle and endAngle specify (in radians) the start and end positions of the arc. The range for both is 2 * pi radians to 2 * pi radians. The default value for startAngle is 0 radians; the default for endAngle is 2 * pi radians.

  • endAngle
    Type: System.Single

    Optional. Single-precision value. When an arc or a partial circle or ellipse is printed, startAngle and endAngle specify (in radians) the start and end positions of the arc. The range for both is 2 * pi radians to 2 * pi radians. The default value for startAngle is 0 radians; the default for endAngle is 2 * pi radians.

  • aspect
    Type: System.Single

    Optional. Single-precision value indicating the aspect ratio of the circle or ellipse. The default value is 1.0, which yields a perfect (non-elliptical) circle on any screen.

Remarks

To fill a circle, set the FillColor and FillStyle properties of the Printer object. Only a closed figure can be filled. Closed figures include circles, ellipses, or pie slices (arcs with radius lines drawn at both ends).

When printing a partial circle or ellipse, if startAngle is negative, Circle prints a radius to startAngle and treats the angle as positive. If endAngle is negative, Circle prints a radius to endAngle and treats the angle as positive. The Circle method always draws in a counter-clockwise (positive) direction.

The width, or thickness, of the line used to print the circle, ellipse, or arc depends on the setting of the DrawWidth property. The manner in which the circle is printed on the background depends on the setting of the DrawStyle property.

When printing pie slices, to print a radius to angle 0 (creating a horizontal line segment to the right), specify a very small negative value for startAngle instead of zero.

You can omit an argument in the middle of the syntax, but you must include the argument's comma before you include the next argument. If you omit an optional argument, omit the comma following the previous specified argument.

When Circle runs, the CurrentX and CurrentY properties are set to the center point specified by the arguments.

Note

Functions and objects in the Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

Examples

The following example demonstrates how to draw a circle.

Dim pr As New Printer
pr.DrawStyle = vbSolid
pr.DrawWidth = 1
pr.FillStyle = vbCross
pr.FillColor = vbRed
pr.Circle(True, 2000, 2000, 1000, vbBlue, -2, 1.5, 1)
pr.EndDoc()

See Also

Circle Overload
Printer Class
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace

7f9351ea-cb3e-4615-8f70-5a29c165c1a7bc1bcb98-e13b-4c68-a514-045c042dbf364e434922-3709-49c6-a69d-38120ed72d7a

Return to top