C# Class Smrf.GraphicsLib.ColorGradientMapper

Maps a range of color metric values to colors within a gradient.
Call the Initialize() method to specify the color metric range, the color gradient to map the range to, and the number of discrete colors to split the gradient into. You can then call ColorMetricToColor() to map a color metric within the range to one of the discrete colors within the gradient, or ColorMetricToBrush() to get a corresponding brush.

Call Dispose() when you are done using the object.

Afficher le fichier Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Свойство Type Description
m_aoDiscreteBrushes System.Drawing.Brush[]
m_aoDiscreteColors Color[]
m_dColorMetricsPerDivision Double
m_dMaxColorMetric Double
m_dMinColorMetric Double
m_iDiscreteColorCount System.Int32

Méthodes publiques

Méthode Description
ColorMetricToBrush ( Double dColorMetric ) : Brush
ColorMetricToColor ( Double dColorMetric ) : Color
Dispose ( ) : void
Initialize ( Double dMinColorMetric, Double dMaxColorMetric, Color oMinColor, Color oMaxColor, Int32 iDiscreteColorCount, System.Boolean bCreateBrushes ) : void

Méthodes protégées

Méthode Description
ColorGradientMapper ( ) : System

Initializes a new instance of the ColorGradientMapper class.

ColorMetricToArrayIndex ( Double dColorMetric ) : Int32
CreateDiscreteBrushes ( Color aoDiscreteColors ) : System.Drawing.Brush[]
CreateDiscreteColors ( Color oMinColor, Color oMaxColor, Int32 iDiscreteColorCount ) : Color[]

Method Details

ColorGradientMapper() protected méthode

Initializes a new instance of the ColorGradientMapper class.
protected ColorGradientMapper ( ) : System
Résultat System

ColorMetricToArrayIndex() protected méthode

protected ColorMetricToArrayIndex ( Double dColorMetric ) : Int32
dColorMetric Double
Résultat System.Int32

ColorMetricToBrush() public méthode

public ColorMetricToBrush ( Double dColorMetric ) : Brush
dColorMetric Double
Résultat System.Drawing.Brush

ColorMetricToColor() public méthode

public ColorMetricToColor ( Double dColorMetric ) : Color
dColorMetric Double
Résultat Color

CreateDiscreteBrushes() protected méthode

protected CreateDiscreteBrushes ( Color aoDiscreteColors ) : System.Drawing.Brush[]
aoDiscreteColors Color
Résultat System.Drawing.Brush[]

CreateDiscreteColors() protected méthode

protected CreateDiscreteColors ( Color oMinColor, Color oMaxColor, Int32 iDiscreteColorCount ) : Color[]
oMinColor Color
oMaxColor Color
iDiscreteColorCount System.Int32
Résultat Color[]

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Initialize() public méthode

public Initialize ( Double dMinColorMetric, Double dMaxColorMetric, Color oMinColor, Color oMaxColor, Int32 iDiscreteColorCount, System.Boolean bCreateBrushes ) : void
dMinColorMetric Double
dMaxColorMetric Double
oMinColor Color
oMaxColor Color
iDiscreteColorCount System.Int32
bCreateBrushes System.Boolean
Résultat void

Property Details

m_aoDiscreteBrushes protected_oe property

protected Brush[],System.Drawing m_aoDiscreteBrushes
Résultat System.Drawing.Brush[]

m_aoDiscreteColors protected_oe property

protected Color[] m_aoDiscreteColors
Résultat Color[]

m_dColorMetricsPerDivision protected_oe property

protected Double m_dColorMetricsPerDivision
Résultat Double

m_dMaxColorMetric protected_oe property

protected Double m_dMaxColorMetric
Résultat Double

m_dMinColorMetric protected_oe property

protected Double m_dMinColorMetric
Résultat Double

m_iDiscreteColorCount protected_oe property

protected Int32,System m_iDiscreteColorCount
Résultat System.Int32