C# Класс System.Drawing.PieChart.PieSlice

Object representing 3D pie.
Наследование: Object, IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
m_boundingRectangle System.Drawing.RectangleF
m_brushEndSide System.Drawing.Brush
m_brushPeripherySurface System.Drawing.Brush
m_brushStartSide System.Drawing.Brush
m_brushSurface System.Drawing.Brush
m_brushSurfaceHighlighted System.Drawing.Brush
m_center System.Drawing.PointF
m_centerBelow System.Drawing.PointF
m_endSide System.Drawing.Quadrilateral
m_pen System.Drawing.Pen
m_pointEnd System.Drawing.PointF
m_pointEndBelow System.Drawing.PointF
m_pointStart System.Drawing.PointF
m_pointStartBelow System.Drawing.PointF
m_sliceHeight float
m_startAngle float
m_startSide System.Drawing.Quadrilateral
m_sweepAngle float

Private Properties

Свойство Тип Описание
BottomSurfaceSectionContainsPoint bool
CreatePathForCylinderSurfaceSection System.Drawing.Drawing2D.GraphicsPath
CylinderSurfaceSectionContainsPoint bool
DrawBottom void
DrawEndSide void
DrawHiddenPeriphery void
DrawSides void
DrawStartSide void
DrawTop void
DrawVisiblePeriphery void
EndSideContainsPoint bool
GetEllipseRadius double
GetFittingRectangle System.Drawing.RectangleF
GetHiddenPeripherySurfaceBounds PeripherySurfaceBounds[]
GetVisiblePeripherySurfaceBounds PeripherySurfaceBounds[]
InitializePieSlice void
InitializeSides void
InitializeSides void
PeripheryContainsPoint bool
PieSliceContainsPoint bool
PieSliceContainsPoint bool
Readjust void
Split System.Drawing.PieChart.PieSlice[]
StartSideContainsPoint bool

Открытые методы

Метод Описание
Contains ( PointF point ) : bool

Checks if given pie slice contains given point.

Dispose ( ) : void

Disposes of all resources used by PieSlice object.

Draw ( Graphics graphics ) : void

Draws the pie slice.

GetTextPosition ( ) : PointF

Evaluates the point in the middle of the slice.

PieSlice ( Rectangle boundingRect, float sliceHeight, float startAngle, float sweepAngle, Color surfaceColor, ShadowStyle shadowStyle, EdgeColorType edgeColorType, float edgeLineWidth ) : System

Initializes a new instance of PieSlice class with given bounds and visual style.

PieSlice ( RectangleF boundingRect, float sliceHeight, float startAngle, float sweepAngle, Color surfaceColor, ShadowStyle shadowStyle, EdgeColorType edgeColorType ) : System

Initializes a new instance of PieSlice class with given bounds and visual style.

PieSlice ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float startAngle, float sweepAngle, Color surfaceColor ) : System

Initializes a new instance of flat PieSlice class with given bounds and visual style.

PieSlice ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float sliceHeight, float startAngle, float sweepAngle, Color surfaceColor, ShadowStyle shadowStyle, EdgeColorType edgeColorType ) : System

Initializes a new instance of PieSlice class with given bounds and visual style.

PieSlice ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float sliceHeight, float startAngle, float sweepAngle, Color surfaceColor, ShadowStyle shadowStyle, EdgeColorType edgeColorType, float edgeLineWidth ) : System

Initializes a new instance of PieSlice class with given bounds and visual style.

Защищенные методы

Метод Описание
CreateBrushForPeriphery ( Color color ) : Brush

Creates a brush for outer periphery of the pie slice used for gradual shadow.

CreateBrushForSide ( Color color, double angle ) : Brush

Creates a brush for start and end sides of the pie slice for gradual shade.

CreateSurfaceBrushes ( Color surfaceColor, ShadowStyle shadowStyle ) : void

Creates brushes used to render the pie slice.

DisposeBrushes ( ) : void

Disposes of brush objects.

DrawCylinderSurfaceSection ( Graphics graphics, Pen pen, Brush brush, float startAngle, float endAngle, PointF pointStart, PointF pointEnd ) : void

Draws the outer periphery of the pie slice.

GetActualAngle ( float transformedAngle ) : float

Gets the actual angle from the rendering angle.

PeripheralPoint ( float xCenter, float yCenter, float semiMajor, float semiMinor, float angleDegrees ) : PointF

Calculates the point on ellipse periphery for angle.

PieSlice ( ) : System

Initializes an empty instance of PieSlice.

TransformAngle ( float angle ) : float

Transforms actual angle to angle used for rendering. They are different because of perspective.

Приватные методы

Метод Описание
BottomSurfaceSectionContainsPoint ( PointF point ) : bool

Checks if bottom side of the pie slice contains the point.

CreatePathForCylinderSurfaceSection ( float startAngle, float endAngle, PointF pointStart, PointF pointEnd ) : GraphicsPath

Creates GraphicsPath for cylinder surface section. This path consists of two arcs and two vertical lines.

CylinderSurfaceSectionContainsPoint ( PointF point, float startAngle, float endAngle, PointF point1, PointF point2 ) : bool

Checks if given point is contained within upper and lower pie slice surfaces or within the outer slice brink.

DrawBottom ( Graphics graphics ) : void

Draws the bottom of the pie slice.

DrawEndSide ( Graphics graphics ) : void

Draws visible end side.

DrawHiddenPeriphery ( Graphics graphics ) : void

Draws hidden outer periphery of the pie slice.

DrawSides ( Graphics graphics ) : void

Draws pie slice sides.

DrawStartSide ( Graphics graphics ) : void

Draws visible start side.

DrawTop ( Graphics graphics ) : void

Draws the top of the pie slice.

DrawVisiblePeriphery ( Graphics graphics ) : void

Draws visible outer periphery of the pie slice.

EndSideContainsPoint ( PointF point ) : bool

Checks if point provided is inside pie slice end cut side.

GetEllipseRadius ( double angle ) : double

Evaluates the distance of an ellipse perimeter point for a given angle.

GetFittingRectangle ( ) : RectangleF

Calculates the smallest rectangle into which this pie slice fits.

GetHiddenPeripherySurfaceBounds ( ) : PeripherySurfaceBounds[]

Gets an array of hidden periphery bounds.

GetVisiblePeripherySurfaceBounds ( ) : PeripherySurfaceBounds[]

Gets an array of visible periphery bounds.

InitializePieSlice ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float sliceHeight ) : void

Initializes pie bounding rectangle, pie height, corners coordinates and brushes used for rendering.

InitializeSides ( ) : void

Initializes start and end pie slice sides.

InitializeSides ( bool startSideExists, bool endSideExists ) : void

Initializes start and end pie slice sides.

PeripheryContainsPoint ( PointF point ) : bool

Checks if given point is contained by cylinder periphery.

PieSliceContainsPoint ( PointF point ) : bool

Checks if given point is contained inside the pie slice.

PieSliceContainsPoint ( PointF point, float xBoundingRectangle, float yBoundingRectangle, float widthBoundingRectangle, float heightBoundingRectangle, float startAngle, float sweepAngle ) : bool

Checks if point given is contained within the pie slice.

Readjust ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float sliceHeight ) : void

Reajusts the pie slice to fit new bounding rectangle provided.

Split ( float splitAngle ) : System.Drawing.PieChart.PieSlice[]

Splits a pie slice into two on the split angle.

StartSideContainsPoint ( PointF point ) : bool

Checks if point provided is inside pie slice start cut side.

Описание методов

Contains() публичный Метод

Checks if given pie slice contains given point.
public Contains ( PointF point ) : bool
point System.Drawing.PointF /// PointF to check. ///
Результат bool

CreateBrushForPeriphery() защищенный Метод

Creates a brush for outer periphery of the pie slice used for gradual shadow.
protected CreateBrushForPeriphery ( Color color ) : Brush
color Color /// Color used for pie slice rendering. ///
Результат System.Drawing.Brush

CreateBrushForSide() защищенный Метод

Creates a brush for start and end sides of the pie slice for gradual shade.
protected CreateBrushForSide ( Color color, double angle ) : Brush
color Color /// Color used for pie slice rendering. ///
angle double /// Angle of the surface. ///
Результат System.Drawing.Brush

CreateSurfaceBrushes() защищенный Метод

Creates brushes used to render the pie slice.
protected CreateSurfaceBrushes ( Color surfaceColor, ShadowStyle shadowStyle ) : void
surfaceColor Color /// Color used for rendering. ///
shadowStyle ShadowStyle /// Shadow style used for rendering. ///
Результат void

Dispose() публичный Метод

Disposes of all resources used by PieSlice object.
public Dispose ( ) : void
Результат void

DisposeBrushes() защищенный Метод

Disposes of brush objects.
protected DisposeBrushes ( ) : void
Результат void

Draw() публичный Метод

Draws the pie slice.
public Draw ( Graphics graphics ) : void
graphics System.Drawing.Graphics /// Graphics used to draw the pie slice. ///
Результат void

DrawCylinderSurfaceSection() защищенный Метод

Draws the outer periphery of the pie slice.
protected DrawCylinderSurfaceSection ( Graphics graphics, Pen pen, Brush brush, float startAngle, float endAngle, PointF pointStart, PointF pointEnd ) : void
graphics System.Drawing.Graphics /// Graphics object used to draw the surface. ///
pen System.Drawing.Pen /// Pen used to draw outline. ///
brush System.Drawing.Brush /// Brush used to fill the quadrilateral. ///
startAngle float /// Start angle (in degrees) of the periphery section. ///
endAngle float /// End angle (in degrees) of the periphery section. ///
pointStart System.Drawing.PointF /// Point representing the start of the periphery. ///
pointEnd System.Drawing.PointF /// Point representing the end of the periphery. ///
Результат void

GetActualAngle() защищенный Метод

Gets the actual angle from the rendering angle.
protected GetActualAngle ( float transformedAngle ) : float
transformedAngle float /// Transformed angle for which actual angle has to be evaluated. ///
Результат float

GetTextPosition() публичный Метод

Evaluates the point in the middle of the slice.
public GetTextPosition ( ) : PointF
Результат System.Drawing.PointF

PeripheralPoint() защищенный Метод

Calculates the point on ellipse periphery for angle.
protected PeripheralPoint ( float xCenter, float yCenter, float semiMajor, float semiMinor, float angleDegrees ) : PointF
xCenter float /// x-coordinate of the center of the ellipse. ///
yCenter float /// y-coordinate of the center of the ellipse. ///
semiMajor float /// Horizontal semi-axis. ///
semiMinor float /// Vertical semi-axis. ///
angleDegrees float /// Angle (in degrees) for which corresponding periphery point has to /// be obtained. ///
Результат System.Drawing.PointF

PieSlice() защищенный Метод

Initializes an empty instance of PieSlice.
protected PieSlice ( ) : System
Результат System

PieSlice() публичный Метод

Initializes a new instance of PieSlice class with given bounds and visual style.
public PieSlice ( Rectangle boundingRect, float sliceHeight, float startAngle, float sweepAngle, Color surfaceColor, ShadowStyle shadowStyle, EdgeColorType edgeColorType, float edgeLineWidth ) : System
boundingRect System.Drawing.Rectangle /// Bounding rectangle used to draw the top surface of the pie slice. ///
sliceHeight float /// Pie slice height. ///
startAngle float /// Starting angle (in degrees) of the pie slice. ///
sweepAngle float /// Sweep angle (in degrees) of the pie slice. ///
surfaceColor Color /// Color used to render pie slice surface. ///
shadowStyle ShadowStyle /// Shadow style used in rendering. ///
edgeColorType EdgeColorType /// Edge color type used for rendering. ///
edgeLineWidth float /// Edge line width. ///
Результат System

PieSlice() публичный Метод

Initializes a new instance of PieSlice class with given bounds and visual style.
public PieSlice ( RectangleF boundingRect, float sliceHeight, float startAngle, float sweepAngle, Color surfaceColor, ShadowStyle shadowStyle, EdgeColorType edgeColorType ) : System
boundingRect System.Drawing.RectangleF /// Bounding rectangle used to draw the top surface of the slice. ///
sliceHeight float /// Pie slice height. ///
startAngle float /// Starting angle (in degrees) of the pie slice. ///
sweepAngle float /// Sweep angle (in degrees) of the pie slice. ///
surfaceColor Color /// Color used to render pie slice surface. ///
shadowStyle ShadowStyle /// Shadow style used in rendering. ///
edgeColorType EdgeColorType /// Edge color type used for rendering. ///
Результат System

PieSlice() публичный Метод

Initializes a new instance of flat PieSlice class with given bounds and visual style.
public PieSlice ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float startAngle, float sweepAngle, Color surfaceColor ) : System
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the pie slice. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the pie slice. ///
widthBoundingRect float /// Width of the rectangle that is used to draw the top surface of /// the pie slice. ///
heightBoundingRect float /// Height of the rectangle that is used to draw the top surface of /// the pie slice. ///
startAngle float /// Starting angle (in degrees) of the pie slice. ///
sweepAngle float /// Sweep angle (in degrees) of the pie slice. ///
surfaceColor Color /// Color used to paint the pie slice. ///
Результат System

PieSlice() публичный Метод

Initializes a new instance of PieSlice class with given bounds and visual style.
public PieSlice ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float sliceHeight, float startAngle, float sweepAngle, Color surfaceColor, ShadowStyle shadowStyle, EdgeColorType edgeColorType ) : System
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the pie slice. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the pie slice. ///
widthBoundingRect float /// Width of the rectangle that is used to draw the top surface of /// the pie slice. ///
heightBoundingRect float /// Height of the rectangle that is used to draw the top surface of /// the pie slice. ///
sliceHeight float /// Height of the pie slice. ///
startAngle float /// Starting angle (in degrees) of the pie slice. ///
sweepAngle float /// Sweep angle (in degrees) of the pie slice. ///
surfaceColor Color /// Color used to paint the pie slice. ///
shadowStyle ShadowStyle /// Shadow style used for slice rendering. ///
edgeColorType EdgeColorType /// Edge color style used for slice rendering. ///
Результат System

PieSlice() публичный Метод

Initializes a new instance of PieSlice class with given bounds and visual style.
public PieSlice ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float sliceHeight, float startAngle, float sweepAngle, Color surfaceColor, ShadowStyle shadowStyle, EdgeColorType edgeColorType, float edgeLineWidth ) : System
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the pie slice. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the pie slice. ///
widthBoundingRect float /// Width of the rectangle that is used to draw the top surface of /// the pie slice. ///
heightBoundingRect float /// Height of the rectangle that is used to draw the top surface of /// the pie slice. ///
sliceHeight float /// Height of the pie slice. ///
startAngle float /// Starting angle (in degrees) of the pie slice. ///
sweepAngle float /// Sweep angle (in degrees) of the pie slice. ///
surfaceColor Color /// Color used to render pie slice surface. ///
shadowStyle ShadowStyle /// Shadow style used in rendering. ///
edgeColorType EdgeColorType /// Edge color type used for rendering. ///
edgeLineWidth float /// Edge line width. ///
Результат System

TransformAngle() защищенный Метод

Transforms actual angle to angle used for rendering. They are different because of perspective.
protected TransformAngle ( float angle ) : float
angle float /// Actual angle. ///
Результат float

Описание свойств

m_boundingRectangle защищенное свойство

Bounding rectangle that bounds the ellipse from which pie slice is cut.
protected RectangleF,System.Drawing m_boundingRectangle
Результат System.Drawing.RectangleF

m_brushEndSide защищенное свойство

Brush used to render slice ending cut side.
protected Brush,System.Drawing m_brushEndSide
Результат System.Drawing.Brush

m_brushPeripherySurface защищенное свойство

Brush used to render pie slice periphery (cylinder outer surface).
protected Brush,System.Drawing m_brushPeripherySurface
Результат System.Drawing.Brush

m_brushStartSide защищенное свойство

Brush used to render slice starting cut side.
protected Brush,System.Drawing m_brushStartSide
Результат System.Drawing.Brush

m_brushSurface защищенное свойство

Brush used to render slice top surface.
protected Brush,System.Drawing m_brushSurface
Результат System.Drawing.Brush

m_brushSurfaceHighlighted защищенное свойство

Brush used to render slice top surface when highlighted.
protected Brush,System.Drawing m_brushSurfaceHighlighted
Результат System.Drawing.Brush

m_center защищенное свойство

PointF corresponding to pie slice center.
protected PointF,System.Drawing m_center
Результат System.Drawing.PointF

m_centerBelow защищенное свойство

PointF corresponding to the lower pie slice center.
protected PointF,System.Drawing m_centerBelow
Результат System.Drawing.PointF

m_endSide защищенное свойство

Quadrilateral representing the end side.
protected Quadrilateral,System.Drawing m_endSide
Результат System.Drawing.Quadrilateral

m_pen защищенное свойство

Pen object used to draw pie slice edges.
protected Pen,System.Drawing m_pen
Результат System.Drawing.Pen

m_pointEnd защищенное свойство

PointF on the periphery corresponding to the end cut side.
protected PointF,System.Drawing m_pointEnd
Результат System.Drawing.PointF

m_pointEndBelow защищенное свойство

PointF on the periphery corresponding to the end cut side.
protected PointF,System.Drawing m_pointEndBelow
Результат System.Drawing.PointF

m_pointStart защищенное свойство

PointF on the periphery corresponding to the start cut side.
protected PointF,System.Drawing m_pointStart
Результат System.Drawing.PointF

m_pointStartBelow защищенное свойство

PointF on the periphery corresponding to the start cut side.
protected PointF,System.Drawing m_pointStartBelow
Результат System.Drawing.PointF

m_sliceHeight защищенное свойство

Pie slice height.
protected float m_sliceHeight
Результат float

m_startAngle защищенное свойство

Start angle.
protected float m_startAngle
Результат float

m_startSide защищенное свойство

Quadrilateral representing the start side.
protected Quadrilateral,System.Drawing m_startSide
Результат System.Drawing.Quadrilateral

m_sweepAngle защищенное свойство

Sweep angle.
protected float m_sweepAngle
Результат float