Draws a section of a circle or an ellipse in an Image variable.

Versions 25 and later

This function is now available for Android applications.

This function is now available for Java applications.

New in version 25

This function is now available for Android applications.

This function is now available for Java applications.

This function is now available for Android applications.

This function is now available for Java applications.

Versions 15 and later

This function is now available for WEBDEV sites in Linux.

Caution: A specific configuration is required to use this function in Linux. See The drawings for more details.

New in version 15

This function is now available for WEBDEV sites in Linux.

Caution: A specific configuration is required to use this function in Linux. See The drawings for more details.

This function is now available for WEBDEV sites in Linux.

Caution: A specific configuration is required to use this function in Linux. See The drawings for more details.

Versions 16 and later

This function is now available for Android applications.

New in version 16

This function is now available for Android applications.

This function is now available for Android applications.

Versions 17 and later

This function is now available for iPhone/iPad applications.

New in version 17

This function is now available for iPhone/iPad applications.

This function is now available for iPhone/iPad applications.

Versions 18 and later

This function is now available in Windows Store apps mode.

New in version 18

This function is now available in Windows Store apps mode.

This function is now available in Windows Store apps mode.

Versions 21 and later

This function is now available in Universal Windows 10 App mode.

New in version 21

This function is now available in Universal Windows 10 App mode.

This function is now available in Universal Windows 10 App mode.

Example

MyImage is Image = "Test.gif" // Draw a circle section whose // background is light yellow and whose border is light blue MyImage.DrawSlice(10, 10, 50, 50, 20, 20, 40, 50, LightYellow, LightBlue) IMG_MyDrawing = MyImage

is identical to the color used for the background if <Image variable>.Pen was not used.

Remarks

Coordinates

If the start point and the end point are not located on the border of the circle (or on the border of the ellipse), the point taken into account corresponds to the intersection between the circle and the line that joins the specified point and the center of the rectangle (which means the center of the circle).
Coordinates are given with respect to the top left corner of the image (coordinates: (0.0)).

The drawing sections are drawn anticlockwise.

Non-solid figure

To draw a non-solid figure (without taking into account the center of the circle), use <Image variable>.DrawChord.

Drawing with opacity or anti-aliasing

For a drawing with opacity (<Image variable>.StartDrawing with the dWithOpacity constant) or anti-aliasing (<Image variable>.ChangeMode with the drawAntiAliasing constant), the outline is drawn over the inside of the section: therefore, the line is partly combined with the inside of the section. If the line is very thick, it will be displayed in two colors.

Related Examples:

Unit examples (WINDEV): The drawing functions

[ + ] Using the main drawing functions of WINDEV to: - Initialize an Image control for drawing - Draw simple shapes - Write a text into a drawing - Change the color in a drawing