"The code is exactly
how I would like to write code and the algorithms used are very
efficient and well-documented."
Van T. Dinh, Microsoft MVP
|
|
Class: CGDIPie
Class that draws pie segments, or a complete pie, using Windows API GDI calls. A pie segment is wedge bounded by the intersection of an ellipse and two radials. The ellipse is drawn within an imaginary bounding rectangle. This class uses the Windows API Pie function to draw the pie segments.
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the CGDIPie class
|
|
BorderColor
|
Property
|
Sets the value of the color used to outline the pie segment
|
|
BorderWidth
|
Property
|
Gets the current value of the BorderWidth used to draw the pie
|
|
Bottom
|
Property
|
Gets the Bottom location of the bounding rectangle for the pie
|
|
FillColor
|
Property
|
Gets the current value of the color used to fill the pie segment
|
|
Left
|
Property
|
Sets the Left location of the bounding rectangle for the pie
|
|
Right
|
Property
|
Gets the Right location of the bounding rectangle for the pie
|
|
Top
|
Property
|
Gets the Top location of the bounding rectangle for the pie
|
|
AddSlice
|
Method
|
Adds a pie segment to the total values which is displayed when the DrawPieSlices method is called.
Call this method repeatedly to add "slices" to a fully-formed pie chart. The class automatically calculates how big each slice should be based on the proportion of the value of this slice to the total of all of the slices. To draw the pie once the slices have been added use DrawPieSlices. To reset pie data before creating a new pie, use ResetPieData.
|
|
DrawPieSlice
|
Method
|
Draw a slice of a pie on a selected device.
The slice is drawn within an ellipse bounded by the dimensions of a rectangle specified in the Left, Top, Bottom and Right properties.
The width of the outline of the pie slice is specified in the BorderWidth property. The color of the the pie segment is specified in the FillColor property
|
|
DrawPieSliceByAngle
|
Method
|
Draw a slice of a pie on a selected device.
The slice is drawn within an ellipse bounded by the dimensions of a rectangle specified in the Left, Top, Bottom and Right properties.
The width of the outline of the pie slice is specified in the BorderWidth property. The color of the the pie segment is specified in the FillColor property
|
|
DrawPieSliceByAngleSweep
|
Method
|
Draw a slice of a pie on a selected device.
The slice is drawn within an ellipse bounded by the dimensions of a rectangle specified in the Left, Top, Bottom and Right properties.
The width of the outline of the pie slice is specified in the BorderWidth property. The color of the the pie segment is specified in the FillColor property
|
|
DrawPieSlices
|
Method
|
Creates a fully-drawn circle or ellipse with pie segments based on values added with the AddSlice method.
The shape of the pie is determined by the bounding rectangle specified in the Left, Top, Bottom and Right properties.
|
|
ResetPieData
|
Method
|
Deletes slice information that was previously added with the AddSlice method. Use this method if you want to create a new set of slices.
|
|
TranslateVBColor
|
Private
|
Translates VB color constants for system colors into GDI equivalents.
VB color constants, such as vbRed, or vbBlue, or values returned using the QBColor() or RGB() functions, can be used directly for the color values used with Windows API calls. However, the VB color constants for system colors (vbButtonFace, vb3DShadow etc.) do not map correctly to those expected by Windows. This wrapper function accepts either form of constant, and translates the value, if necessary, into the equivalent value expected by the Windows GDI subsystem.
|
Overview of Total Visual SourceBook
The source code in Total Visual
SourceBook includes modules and classes for Microsoft Access, Visual
Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily
add this professionally written, tested, and documented royalty-free code
into your applications to simplify your application development efforts.
Additional Resources
|
|