Printer.Circle Method (Single, Single, Single, Int32, Single, Single, Single)
Prints a circle, an ellipse, or an arc on a page.
Namespace: Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaration
Public Sub Circle ( _
x As Single, _
y As Single, _
radius As Single, _
color As Integer, _
startAngle As Single, _
endAngle As Single, _
aspect As Single _
)
public void Circle(
float x,
float y,
float radius,
int color,
float startAngle,
float endAngle,
float aspect
)
public:
void Circle(
float x,
float y,
float radius,
int color,
float startAngle,
float endAngle,
float aspect
)
member Circle :
x:float32 *
y:float32 *
radius:float32 *
color:int *
startAngle:float32 *
endAngle:float32 *
aspect:float32 -> unit
public function Circle(
x : float,
y : float,
radius : float,
color : int,
startAngle : float,
endAngle : float,
aspect : float
)
Parameters
x
Type: System.SingleSingle value indicating the horizontal coordinate for the center point of the circle, ellipse, or arc. The ScaleMode property determines the units of measurement used.
y
Type: System.SingleSingle value indicating the vertical coordinate for the center point of the circle, ellipse, or arc. The ScaleMode property determines the units of measurement used.
radius
Type: System.SingleSingle value indicating the radius of the circle or ellipse. The ScaleMode property determines the units of measurement used.
color
Type: System.Int32Optional. 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.SingleOptional. 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.SingleOptional. 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.SingleOptional. 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(2000, 2000, 1000)
pr.EndDoc()
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace
Other Resources
How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)
Deploying Applications That Reference the Printer Compatibility Library