Report.Circle 方法 (Access)Report.Circle method (Access)

Circle方法繪製圓形、 橢圓形或弧形Report物件上Print事件發生時。The Circle method draws a circle, an ellipse, or an arc on a Report object when the Print event occurs.

語法Syntax

運算式黑色圓形步驟x,y)、半徑色彩啟動結束([長寬expression.Circle (Step (x, y), Radius, Color, Start, End, Aspect)

_運算式_代表**Report** 物件的變數。expression A variable that represents a Report object.

參數Parameters

名稱Name 資料類型Data type 描述Description
步驟Step 關鍵字Keyword 指出圓形、 橢圓形或弧形中心相對於_Object_引數的**CurrentX** 和**CurrentY** 屬性的目前設定所提供的目前座標。Indicates that the center of the circle, ellipse, or arc is relative to the current coordinates given by the current settings for the CurrentX and CurrentY properties of the Object argument.
x,y(x, y) SingleSingle 會指出圓形、 橢圓形或弧形的中心點的座標。_物件_引數所指定的Report物件的縮放比例屬性 (ScaleModeScaleLeftScaleTopScaleHeight、 及ScaleWidth) 決定所使用的度量單位。Indicates the coordinates of the center point of the circle, ellipse, or arc. The Scale properties (ScaleMode, ScaleLeft, ScaleTop, ScaleHeight, and ScaleWidth) of the Report object specified by the Object argument determine the unit of measure used.
RadiusRadius SingleSingle 會指出圓形、 橢圓形或弧形的半徑。_物件_引數所指定的Report物件的縮放比例屬性 (ScaleModeScaleLeftScaleTopScaleHeight、 及ScaleWidth) 決定所使用的度量單位。Indicates the radius of the circle, ellipse, or arc. The Scale properties (ScaleMode, ScaleLeft, ScaleTop, ScaleHeight, and ScaleWidth) of the Report object specified by the Object argument determine the unit of measure used. 預設情況下,距離的計算單位是以twip 為單位By default, distances are measured in twips.
ColorColor LongLong 會指出 RGB (紅-綠-藍) 色彩之圓形大綱。Indicates the RGB (red-green-blue) color of the circle outline. 如果省略此引數,則會使用 ForeColor 屬性的值。If this argument is omitted, the value of the ForeColor property is used. 您也可以使用 RGB 函數或 QBColor 函數來指定色彩。You can also use the RGB function or QBColor function to specify the color.
StartStart SingleSingle 繪製的部分圓形或橢圓形, _Start_引數指定弧線中點的開頭位置 (以弧度表示)。將_Start_引數的預設值是 0 弧度。When a partial circle or ellipse is drawn, the Start argument specifies (in radians) the beginning position of the arc. The default value for the Start argument is 0 radians. 範圍是-2 pi 弧度到 2 pi 弧度。The range is -2 pi radians to 2 pi radians.
EndEnd SingleSingle 繪製部分圓形或橢圓時, _End_引數指定弧線結束的位置 (以弧度表示)。_End_引數的預設值是 2 pi 弧度。When a partial circle or ellipse is drawn, the End argument specifies (in radians) the end position of the arc. The default value for the End argument is 2 pi radians. 範圍是-2 pi 弧度到 2 pi 弧度。The range is -2 pi radians to 2 pi radians.
外觀Aspect SingleSingle 會指出圓形的外觀比例。Indicates the aspect ratio of the circle. 預設值為 1.0,會在任何畫面上產生完美的 (非橢圓) 圓形。The default value is 1.0, which yields a perfect (nonelliptical) circle on any screen.

註解Remarks

您只能在報表區段的事件屬性,或報表的 OnPage 事件屬性所指定事件程序或巨集中使用此方法。You can use this method only in an event procedure or a macro specified by the event properties for a report section, or the OnPage event property for a report.

繪製時的部分圓形或橢圓形,如果將_Start_引數為負數, Circle方法繪製半徑,同時_啟動_引數所指定的位置,並將角度視為正數。When drawing a partial circle or ellipse, if the Start argument is negative, the Circle method draws a radius to the position specified by the Start argument and treats the angle as positive. 如果_End_引數為負數, Circle方法繪製半徑,同時在_End_引數所指定的位置,並再次來說角度視為正數。If the End argument is negative, the Circle method draws a radius to the position specified by the End argument and again treats the angle as positive. Circle 方法會固定以逆時針 (正) 方向繪製。The Circle method always draws in a counterclockwise (positive) direction.

若要填滿圓形,請設定報表的 FillColorFillStyle 屬性。To fill a circle, set the FillColor and FillStyle properties of the report. 只有封閉圖形可以填滿。Only a closed figure can be filled. 封閉圖形包括圓形、橢圓形及圓形切片,其為在兩端繪製半徑線條的弧形。Closed figures include circles, ellipses, and pie slices, which are arcs with radius lines drawn at both ends.

繪製時圓形切片,如果您要繪製半徑以角度為 0 到表單右邊的水平線條線段,指定非常小的負數, _Start_引數,而不是 0。When drawing pie slices, if you need to draw a radius to angle 0 to form a horizontal line segment to the right, specify a very small negative value for the Start argument rather than 0. 例如,您可以指定-.00000001_啟動_引數。For example, you might specify -.00000001 for the Start argument.

您可以省略語法中間的引數,但是必須在下一個引數之前加入引數的逗號。You can omit an argument in the middle of the syntax, but you must include the argument's comma before including the next argument. 如果您省略末尾的引數,不使用任何您指定的最後一個引數後面的逗點。If you omit a trailing argument, don't use any commas following the last argument that you specify.

用來繪製圓形、 橢圓形或弧形的線條寬度取決於**DrawWidth** 屬性設定值。The width of the line used to draw the circle, ellipse, or arc depends on the DrawWidth property setting. 在背景中繪製圓形的方式取決於**DrawMode** 和**DrawStyle** 屬性的設定。The way the circle is drawn on the background depends on the settings of the DrawMode and DrawStyle properties.

當您套用 Circle 方法時,CurrentXCurrentY 屬性會設定為_x_ 及 y 引數所指定的中心點。When you apply the Circle method, the CurrentX and CurrentY properties are set to the center point specified by the x and y arguments.

範例Example

以下範例使用 Circle 方法繪製圓形,然後在圓形內建立圓形切片,並以紅色著色。The following example uses the Circle method to draw a circle, and then create a pie slice within the circle and color it red.

若要在 Microsoft Access 中嘗試此範例,請建立一個新報表。To try this example in Microsoft Access, create a new report. 將詳細資料區段的 OnPrint 屬性設定為 [事件程序]。Set the OnPrint property of the Detail section to [Event Procedure]. 在報表的模組中,輸入下列程式碼,然後切換至預覽列印]。Enter the following code in the report's module, and then switch to Print Preview.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) 
    Const conPI = 3.14159265359 
    Dim sngHCtr As Single, sngVCtr As Single 
    Dim sngRadius As Single 
    Dim sngStart As Single, sngEnd As Single 
 
    sngHCtr = Me.ScaleWidth / 2     ' Horizontal center. 
    sngVCtr = Me.ScaleHeight / 2     ' Vertical center. 
    sngRadius = Me.ScaleHeight / 3     ' Circle radius. 
    ' Draw circle. 
    Me.Circle(sngHCtr, sngVCtr), sngRadius 
    sngStart = -0.00000001             ' Start of pie slice. 
    sngEnd = -2 * conPI / 3             ' End of pie slice. 
    Me.FillColor = RGB(255,0,0)     ' Color pie slice red. 
    Me.FillStyle = 0                     ' Fill pie slice. 
    ' Draw pie slice within circle. 
    Me.Circle(sngHCtr, sngVCtr), sngRadius, , sngStart, sngEnd 
End Sub

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.