当前位置: 首页>>代码示例>>C#>>正文


C# GraphPane.ScaledPenWidth方法代码示例

本文整理汇总了C#中MathToolBelt.Sorting.Ui.App.ZedGraph.GraphPane.ScaledPenWidth方法的典型用法代码示例。如果您正苦于以下问题:C# GraphPane.ScaledPenWidth方法的具体用法?C# GraphPane.ScaledPenWidth怎么用?C# GraphPane.ScaledPenWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MathToolBelt.Sorting.Ui.App.ZedGraph.GraphPane的用法示例。


在下文中一共展示了GraphPane.ScaledPenWidth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetPen

 internal Pen GetPen( GraphPane pane, float scaleFactor )
 {
     return new Pen( _color, pane.ScaledPenWidth( _penWidth, scaleFactor ) );
 }
开发者ID:nic0lae,项目名称:mathtoolbelt,代码行数:4,代码来源:MinorTic.cs

示例2: DrawMinorTics

        /// <summary>
        /// Draw the minor tic marks as required for this <see cref="Axis"/>.
        /// </summary>
        /// <param name="g">
        /// A graphic device object to be drawn into.  This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="pane">
        /// A reference to the <see cref="ZedGraph.GraphPane"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="baseVal">
        /// The scale value for the first major tic position.  This is the reference point
        /// for all other tic marks.
        /// </param>
        /// <param name="shift">The number of pixels to shift this axis, based on the
        /// value of <see cref="Cross"/>.  A positive value is into the ChartRect relative to
        /// the default axis position.</param>
        /// <param name="scaleFactor">
        /// The scaling factor to be used for rendering objects.  This is calculated and
        /// passed down by the parent <see cref="GraphPane"/> object using the
        /// <see cref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
        /// font sizes, etc. according to the actual size of the graph.
        /// </param>
        /// <param name="topPix">
        /// The pixel location of the far side of the ChartRect from this axis.
        /// This value is the ChartRect.Height for the XAxis, or the ChartRect.Width
        /// for the YAxis and Y2Axis.
        /// </param>
        public void DrawMinorTics( Graphics g, GraphPane pane, double baseVal, float shift,
								float scaleFactor, float topPix )
        {
            if ( ( this.MinorTic.IsOutside || this.MinorTic.IsOpposite || this.MinorTic.IsInside ||
                    this.MinorTic._isCrossOutside || this.MinorTic._isCrossInside || _minorGrid._isVisible )
                    && _isVisible )
            {
                double	tMajor = _scale._majorStep * _scale.MajorUnitMultiplier,
                            tMinor = _scale._minorStep * _scale.MinorUnitMultiplier;

                if ( _scale.IsLog || tMinor < tMajor )
                {
                    float minorScaledTic = this.MinorTic.ScaledTic( scaleFactor );

                    // Minor tics start at the minimum value and step all the way thru
                    // the full scale.  This means that if the minor step size is not
                    // an even division of the major step size, the minor tics won't
                    // line up with all of the scale labels and major tics.
                    double	first = _scale._minLinTemp,
                                last = _scale._maxLinTemp;

                    double dVal = first;
                    float pixVal;

                    int iTic = _scale.CalcMinorStart( baseVal );
                    int MajorTic = 0;
                    double majorVal = _scale.CalcMajorTicValue( baseVal, MajorTic );

                    using ( Pen	pen = new Pen( _minorTic._color,
                                        pane.ScaledPenWidth( MinorTic._penWidth, scaleFactor ) ) )
                    using ( Pen minorGridPen = _minorGrid.GetPen( pane, scaleFactor ) )
                    {

                        // Draw the minor tic marks
                        while ( dVal < last && iTic < 5000 )
                        {
                            // Calculate the scale value for the current tic
                            dVal = _scale.CalcMinorTicValue( baseVal, iTic );
                            // Maintain a value for the current major tic
                            if ( dVal > majorVal )
                                majorVal = _scale.CalcMajorTicValue( baseVal, ++MajorTic );

                            // Make sure that the current value does not match up with a major tic
                            if ( ( ( Math.Abs( dVal ) < 1e-20 && Math.Abs( dVal - majorVal ) > 1e-20 ) ||
                                ( Math.Abs( dVal ) > 1e-20 && Math.Abs( ( dVal - majorVal ) / dVal ) > 1e-10 ) ) &&
                                ( dVal >= first && dVal <= last ) )
                            {
                                pixVal = _scale.LocalTransform( dVal );

                                _minorGrid.Draw( g, minorGridPen, pixVal, topPix );

                                _minorTic.Draw( g, pane, pen, pixVal, topPix, shift, minorScaledTic );
                            }

                            iTic++;
                        }
                    }
                }
            }
        }
开发者ID:nic0lae,项目名称:mathtoolbelt,代码行数:89,代码来源:Axis.cs

示例3: FixZeroLine

        internal void FixZeroLine( Graphics g, GraphPane pane, float scaleFactor,
				float left, float right )
        {
            // restore the zero line if needed (since the fill tends to cover it up)
            if ( _isVisible && _majorGrid._isZeroLine &&
                    _scale._min < 0.0 && _scale._max > 0.0 )
            {
                float zeroPix = _scale.Transform( 0.0 );

                using ( Pen zeroPen = new Pen( _color,
                        pane.ScaledPenWidth( _majorGrid._penWidth, scaleFactor ) ) )
                {
                    g.DrawLine( zeroPen, left, zeroPix, right, zeroPix );
                    //zeroPen.Dispose();
                }
            }
        }
开发者ID:nic0lae,项目名称:mathtoolbelt,代码行数:17,代码来源:Axis.cs

示例4: Draw

        /// <summary>
        /// Draw the scale, including the tic marks, value labels, and grid lines as
        /// required for this <see cref="Axis"/>.
        /// </summary>
        /// <param name="g">
        /// A graphic device object to be drawn into.  This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="pane">
        /// A reference to the <see cref="GraphPane"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="scaleFactor">
        /// The scaling factor to be used for rendering objects.  This is calculated and
        /// passed down by the parent <see cref="GraphPane"/> object using the
        /// <see cref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
        /// font sizes, etc. according to the actual size of the graph.
        /// </param>
        /// <param name="shiftPos">
        /// The number of pixels to shift to account for non-primary axis position (e.g.,
        /// the second, third, fourth, etc. <see cref="YAxis" /> or <see cref="Y2Axis" />.
        /// </param>
        internal void Draw( Graphics g, GraphPane pane, float scaleFactor, float shiftPos )
        {
            MajorGrid majorGrid = _ownerAxis._majorGrid;
            MajorTic majorTic = _ownerAxis._majorTic;
            MinorTic minorTic = _ownerAxis._minorTic;

            float rightPix,
                    topPix;

            GetTopRightPix( pane, out topPix, out rightPix );

            // calculate the total number of major tics required
            int nTics = CalcNumTics();

            // get the first major tic value
            double baseVal = CalcBaseTic();

            using ( Pen pen = new Pen( _ownerAxis.Color,
                        pane.ScaledPenWidth( majorTic._penWidth, scaleFactor ) ) )
            {

                // redraw the axis border
                if ( _ownerAxis.IsAxisSegmentVisible )
                    g.DrawLine( pen, 0.0F, shiftPos, rightPix, shiftPos );

                // Draw a zero-value line if needed
                if ( majorGrid._isZeroLine && _min < 0.0 && _max > 0.0 )
                {
                    float zeroPix = LocalTransform( 0.0 );
                    g.DrawLine( pen, zeroPix, 0.0F, zeroPix, topPix );
                }
            }

            // draw the major tics and labels
            DrawLabels( g, pane, baseVal, nTics, topPix, shiftPos, scaleFactor );

            //			_ownerAxis.DrawMinorTics( g, pane, baseVal, shiftPos, scaleFactor, topPix );

            _ownerAxis.DrawTitle( g, pane, shiftPos, scaleFactor );
        }
开发者ID:nic0lae,项目名称:mathtoolbelt,代码行数:62,代码来源:Scale.cs

示例5: GetPen

        internal Pen GetPen( GraphPane pane, float scaleFactor )
        {
            Pen pen = new Pen( _color,
                        pane.ScaledPenWidth( _penWidth, scaleFactor ) );

            if ( _dashOff > 1e-10 && _dashOn > 1e-10 )
            {
                pen.DashStyle = DashStyle.Custom;
                float[] pattern = new float[2];
                pattern[0] = _dashOn;
                pattern[1] = _dashOff;
                pen.DashPattern = pattern;
            }

            return pen;
        }
开发者ID:nic0lae,项目名称:mathtoolbelt,代码行数:16,代码来源:MinorGrid.cs

示例6: DrawLegendKey

        /// <summary>
        /// Render the label for this <see cref="GasGaugeNeedle"/>.
        /// </summary>
        /// <param name="g">
        /// A graphic device object to be drawn into. This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="pane">
        /// A graphic device object to be drawn into. This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="rect">Bounding rectangle for this <see cref="GasGaugeNeedle"/>.</param>
        /// <param name="scaleFactor">
        /// The scaling factor to be used for rendering objects. This is calculated and
        /// passed down by the parent <see cref="ZedGraph.GraphPane"/> object using the
        /// <see cref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
        /// font sizes, etc. according to the actual size of the graph.
        /// </param> 
        public override void DrawLegendKey( Graphics g, GraphPane pane, RectangleF rect, float scaleFactor )
        {
            if ( !_isVisible )
                return;

            float yMid = rect.Top + rect.Height / 2.0F;

            Pen pen = new Pen( NeedleColor, pane.ScaledPenWidth( NeedleWidth / 2, scaleFactor ) );
            pen.StartCap = LineCap.Round;
            pen.EndCap = LineCap.ArrowAnchor;
            pen.DashStyle = DashStyle.Solid;
            g.DrawLine( pen, rect.Left, yMid, rect.Right, yMid );
        }
开发者ID:nic0lae,项目名称:mathtoolbelt,代码行数:31,代码来源:GasGaugeNeedle.cs


注:本文中的MathToolBelt.Sorting.Ui.App.ZedGraph.GraphPane.ScaledPenWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。