• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ZedGraph.PaneBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ZedGraph.PaneBase的典型用法代码示例。如果您正苦于以下问题:C# PaneBase类的具体用法?C# PaneBase怎么用?C# PaneBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PaneBase类属于ZedGraph命名空间,在下文中一共展示了PaneBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetPen

        public Pen GetPen( PaneBase pane, float scaleFactor, PointPair dataValue )
        {
            Color color = _color;
            if ( _gradientFill.IsGradientValueType )
                color = _gradientFill.GetGradientColor( dataValue );

            Pen pen = new Pen( color,
                        pane.ScaledPenWidth( _width, scaleFactor ) );

            pen.DashStyle = _style;

            if ( _style == DashStyle.Custom )
            {
                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;
                }
                else
                    pen.DashStyle = DashStyle.Solid;
            }

            return pen;
        }
开发者ID:RFExplorer,项目名称:rfexplorer-1,代码行数:27,代码来源:LineBase.cs


示例2: FindPoint

		/// <summary>
		/// Determine if a mouse point is within the legend, and if so, which legend
		/// entry (<see cref="CurveItem"/>) is nearest.
		/// </summary>
		/// <param name="mousePt">The screen point, in pixel coordinates.</param>
		/// <param name="pane">
		/// A reference to the <see cref="PaneBase"/> 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="index">The index number of the <see cref="CurveItem"/> legend
		/// entry that is under the mouse point.  The <see cref="CurveItem"/> object is
		/// accessible via <see cref="GraphPane.CurveList">CurveList[index]</see>.
		/// </param>
		/// <returns>true if the mouse point is within the <see cref="Legend"/> bounding
		/// box, false otherwise.</returns>
		/// <seealso cref="GraphPane.FindNearestObject"/>
		public bool FindPoint( PointF mousePt, PaneBase pane, float scaleFactor, out int index )
		{
			index = -1;

			if ( _rect.Contains( mousePt ) )
			{
				int j = (int)( ( mousePt.Y - _rect.Top ) / _legendItemHeight );
				int i = (int)( ( mousePt.X - _rect.Left - _tmpSize / 2.0f ) / _legendItemWidth );
				if ( i < 0 )
					i = 0;
				if ( i >= _hStack )
					i = _hStack - 1;

				int pos = i + j * _hStack;
				index = 0;

				PaneList paneList = GetPaneList( pane );

				foreach ( GraphPane tmpPane in paneList )
				{
					foreach ( CurveItem curve in tmpPane.CurveList )
					{
						if ( curve._label._isVisible && curve._label._text != string.Empty )
						{
							if ( pos == 0 )
								return true;
							pos--;
						}
						index++;
					}
				}

				return true;
			}
			else
				return false;
		}
开发者ID:jackmaynard,项目名称:MissionPlanner,代码行数:59,代码来源:Legend.cs


示例3: CalcRect

		/// <summary>
		/// Calculate the <see cref="Legend"/> rectangle (<see cref="Rect"/>),
		/// taking into account the number of required legend
		/// entries, and the legend drawing preferences.
		/// </summary>
		/// <remarks>Adjust the size of the
		/// <see cref="Chart.Rect"/> for the parent <see cref="GraphPane"/> to accomodate the
		/// space required by the legend.
		/// </remarks>
		/// <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="PaneBase"/> 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="tChartRect">
		/// The rectangle that contains the area bounded by the axes, in pixel units.
		/// <seealso cref="Chart.Rect" />
		/// </param>
		public void CalcRect( Graphics g, PaneBase pane, float scaleFactor,
			ref RectangleF tChartRect )
		{
			// Start with an empty rectangle
			_rect = Rectangle.Empty;
			_hStack = 1;
			_legendItemWidth = 1;
			_legendItemHeight = 0;

			RectangleF clientRect = pane.CalcClientRect( g, scaleFactor );

			// If the legend is invisible, don't do anything
			if ( !_isVisible )
				return;

			int nCurve = 0;

			PaneList paneList = GetPaneList( pane );
			_tmpSize = GetMaxHeight( paneList, g, scaleFactor );

			float halfGap = _tmpSize / 2.0F,
					maxWidth = 0,
					tmpWidth,
					gapPix = _gap * _tmpSize;

			foreach ( GraphPane tmpPane in paneList )
			{
				// Loop through each curve in the curve list
				// Find the maximum width of the legend labels
				//foreach ( CurveItem curve in tmpPane.CurveList )
				//foreach ( CurveItem curve in GetIterator( tmpPane.CurveList, _isReverse ) )
				int count = tmpPane.CurveList.Count;
				for ( int i = 0; i < count; i++ )
				{
					CurveItem curve = tmpPane.CurveList[_isReverse ? count - i - 1 : i];
					if ( curve._label._text != string.Empty && curve._label._isVisible )
					{
						// Calculate the width of the label save the max width
						FontSpec tmpFont = ( curve._label._fontSpec != null ) ?
										curve._label._fontSpec : this.FontSpec;

						tmpWidth = tmpFont.GetWidth( g, curve._label._text, scaleFactor ) / 2;

						if ( tmpWidth > maxWidth )
							maxWidth = tmpWidth;

						// Save the maximum symbol height for line-type curves
						if ( curve is LineItem && ( (LineItem)curve ).Symbol.Size > _legendItemHeight )
							_legendItemHeight = ( (LineItem)curve ).Symbol.Size;

						nCurve++;
					}
				}

				if ( pane is MasterPane && ( (MasterPane)pane ).IsUniformLegendEntries )
					break;
			}

			float widthAvail;

			// Is this legend horizontally stacked?

			if ( _isHStack )
			{
				// Determine the available space for horizontal stacking
				switch ( _position )
				{
					// Never stack if the legend is to the right or left
					case LegendPos.Right:
					case LegendPos.Left:
						widthAvail = 0;
						break;

//.........这里部分代码省略.........
开发者ID:jackmaynard,项目名称:MissionPlanner,代码行数:101,代码来源:Legend.cs


示例4: Draw

 /// <summary>
 /// Render this <see cref="GraphObj"/> object to the specified <see cref="Graphics"/> device.
 /// </summary>
 /// <remarks>
 /// This method is normally only called by the Draw method
 /// of the parent <see cref="GraphObjList"/> collection object.
 /// </remarks>
 /// <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="PaneBase"/> 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="PaneBase"/> 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 abstract void Draw( Graphics g, PaneBase pane, float scaleFactor );
开发者ID:viwhi1,项目名称:TDMaker,代码行数:22,代码来源:GraphObj.cs


示例5: PointInBox

        /// <summary>
        /// Determine if the specified screen point lies inside the bounding box of this
        /// <see cref="GraphObj"/>.
        /// </summary>
        /// <param name="pt">The screen point, in pixels</param>
        /// <param name="pane">
        /// A reference to the <see cref="PaneBase"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <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="scaleFactor">
        /// The scaling factor to be used for rendering objects.  This is calculated and
        /// passed down by the parent <see cref="PaneBase"/> 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>
        /// <returns>true if the point lies in the bounding box, false otherwise</returns>
        public virtual bool PointInBox( PointF pt, PaneBase pane, Graphics g, float scaleFactor )
        {
            GraphPane gPane = pane as GraphPane;

            if ( gPane != null && _isClippedToChartRect && !gPane.Chart.Rect.Contains( pt ) )
                return false;

            return true;
        }
开发者ID:viwhi1,项目名称:TDMaker,代码行数:29,代码来源:GraphObj.cs


示例6: GetCoords

		/// <summary>
		/// Determines the shape type and Coords values for this GraphObj
		/// </summary>
		override public void GetCoords( PaneBase pane, Graphics g, float scaleFactor,
				out string shape, out string coords )
		{
			// transform the x,y location from the user-defined
			// coordinate frame to the screen pixel location
			RectangleF pixRect = _location.TransformRect( pane );

			shape = "rect";
			coords = String.Format( "{0:f0},{1:f0},{2:f0},{3:f0}",
						pixRect.Left, pixRect.Top, pixRect.Right, pixRect.Bottom );
		}
开发者ID:RobertCL,项目名称:MissionPlanner,代码行数:14,代码来源:BoxObj.cs


示例7: GetCoords

        /// <summary>
        /// Determines the shape type and Coords values for this GraphObj
        /// </summary>
        public override void GetCoords( PaneBase pane, Graphics g, float scaleFactor,
				out string shape, out string coords )
        {
            // transform the x,y location from the user-defined
            // coordinate frame to the screen pixel location
            PointF pix = _location.Transform( pane );

            PointF[] pts = _fontSpec.GetBox( g, _text, pix.X, pix.Y, _location.AlignH,
                _location.AlignV, scaleFactor, new SizeF() );

            shape = "poly";
            coords = String.Format( "{0:f0},{1:f0},{2:f0},{3:f0},{4:f0},{5:f0},{6:f0},{7:f0},",
                        pts[0].X, pts[0].Y, pts[1].X, pts[1].Y,
                        pts[2].X, pts[2].Y, pts[3].X, pts[3].Y );
        }
开发者ID:viwhi1,项目名称:TDMaker,代码行数:18,代码来源:TextObj.cs


示例8: Draw

        /// <summary>
        /// Render this object to the specified <see cref="Graphics"/> device.
        /// </summary>
        /// <remarks>
        /// This method is normally only called by the Draw method
        /// of the parent <see cref="GraphObjList"/> collection object.
        /// </remarks>
        /// <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="PaneBase"/> 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>
        override public void Draw( Graphics g, PaneBase pane, float scaleFactor )
        {
            if ( _points != null && _points.Length > 1 )
            {
                using ( GraphicsPath path = MakePath( pane ) )
                {
                    // Fill or draw the symbol as required
                    if ( _fill.IsVisible )
                    {
                        using ( Brush brush = this.Fill.MakeBrush( path.GetBounds() ) )
                            g.FillPath( brush, path );
                    }

                    if ( _border.IsVisible )
                    {
                        using ( Pen pen = _border.GetPen( pane, scaleFactor ) )
                            g.DrawPath( pen, path );
                    }
                }
            }
        }
开发者ID:RFExplorer,项目名称:rfexplorer-1,代码行数:42,代码来源:PolyObj.cs


示例9: MakePath

        internal GraphicsPath MakePath( PaneBase pane )
        {
            GraphicsPath path = new GraphicsPath();
            bool first = true;
            PointF lastPt = new PointF();

            foreach( PointD pt in _points )
            {
                // Convert the coordinates from the user coordinate system
                // to the screen coordinate system
                // Offset the points by the location value
                PointF pixPt = Location.Transform( pane, pt.X + _location.X, pt.Y + _location.Y,
                        _location.CoordinateFrame );

                if (	Math.Abs( pixPt.X ) < 100000 &&
                        Math.Abs( pixPt.Y ) < 100000 )
                {
                    if ( first )
                        first = false;
                    else
                        path.AddLine( lastPt, pixPt );

                    lastPt = pixPt;
                }
            }

            if ( _isClosedFigure )
                path.CloseFigure();

            return path;
        }
开发者ID:RFExplorer,项目名称:rfexplorer-1,代码行数:31,代码来源:PolyObj.cs


示例10: Draw

        /// <summary>
        /// Render the specified <paramref name="text"/> to the specifed
        /// <see cref="Graphics"/> device.  The text, border, and fill options
        /// will be rendered as required.
        /// </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="PaneBase"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="text">A string value containing the text to be
        /// displayed.  This can be multiple lines, separated by newline ('\n')
        /// characters</param>
        /// <param name="x">The X location to display the text, in screen
        /// coordinates, relative to the horizontal (<see cref="AlignH"/>)
        /// alignment parameter <paramref name="alignH"/></param>
        /// <param name="y">The Y location to display the text, in screen
        /// coordinates, relative to the vertical (<see cref="AlignV"/>
        /// alignment parameter <paramref name="alignV"/></param>
        /// <param name="alignH">A horizontal alignment parameter specified
        /// using the <see cref="AlignH"/> enum type</param>
        /// <param name="alignV">A vertical alignment parameter specified
        /// using the <see cref="AlignV"/> enum type</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>
        public void Draw( Graphics g, PaneBase pane, string text, float x,
			float y, AlignH alignH, AlignV alignV,
			float scaleFactor )
        {
            this.Draw( g, pane, text, x, y, alignH, alignV,
                        scaleFactor, new SizeF() );
        }
开发者ID:sntree,项目名称:ZedGraph,代码行数:39,代码来源:FontSpec.cs


示例11: PointInBox

        /// <summary>
        /// Determine if the specified screen point lies inside the bounding box of this
        /// <see cref="LineObj"/>.
        /// </summary>
        /// <remarks>The bounding box is calculated assuming a distance
        /// of <see cref="GraphPane.Default.NearestTol"/> pixels around the arrow segment.
        /// </remarks>
        /// <param name="pt">The screen point, in pixels</param>
        /// <param name="pane">
        /// A reference to the <see cref="PaneBase"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <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="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>
        /// <returns>true if the point lies in the bounding box, false otherwise</returns>
        public override bool PointInBox(PointF pt, PaneBase pane, Graphics g, float scaleFactor)
        {
            if (! base.PointInBox(pt, pane, g, scaleFactor))
                return false;

            // transform the x,y location from the user-defined
            // coordinate frame to the screen pixel location
            PointF pix = _location.TransformTopLeft(pane);
            PointF pix2 = _location.TransformBottomRight(pane);

            using (var pen = new Pen(Color.Black, (float) GraphPane.Default.NearestTol*2.0F))
            {
                using (var path = new GraphicsPath())
                {
                    path.AddLine(pix, pix2);
                    return path.IsOutlineVisible(pt, pen);
                }
            }
        }
开发者ID:apravdivy,项目名称:MagistrSolution,代码行数:42,代码来源:LineObj.cs


示例12: GetCoords

        /// <summary>
        /// Determines the shape type and Coords values for this GraphObj
        /// </summary>
        public override void GetCoords(PaneBase pane, Graphics g, float scaleFactor,
                                       out string shape, out string coords)
        {
            // transform the x,y location from the user-defined
            // coordinate frame to the screen pixel location
            RectangleF pixRect = _location.TransformRect(pane);

            var matrix = new Matrix();
            if (pixRect.Right == 0)
                pixRect.Width = 1;
            var angle = (float) Math.Atan((pixRect.Top - pixRect.Bottom)/
                                          (pixRect.Left - pixRect.Right));
            matrix.Rotate(angle, MatrixOrder.Prepend);

            // Move the coordinate system to local coordinates
            // of this text object (that is, at the specified
            // x,y location)
            matrix.Translate(-pixRect.Left, -pixRect.Top, MatrixOrder.Prepend);

            var pts = new PointF[4];
            pts[0] = new PointF(0, 3);
            pts[1] = new PointF(pixRect.Width, 3);
            pts[2] = new PointF(pixRect.Width, -3);
            pts[3] = new PointF(0, -3);
            matrix.TransformPoints(pts);

            shape = "poly";
            coords = String.Format("{0:f0},{1:f0},{2:f0},{3:f0},{4:f0},{5:f0},{6:f0},{7:f0},",
                                   pts[0].X, pts[0].Y, pts[1].X, pts[1].Y,
                                   pts[2].X, pts[2].Y, pts[3].X, pts[3].Y);
        }
开发者ID:apravdivy,项目名称:MagistrSolution,代码行数:34,代码来源:LineObj.cs


示例13: Draw

        /// <summary>
        /// Render this object to the specified <see cref="Graphics"/> device.
        /// </summary>
        /// <remarks>
        /// This method is normally only called by the Draw method
        /// of the parent <see cref="GraphObjList"/> collection object.
        /// </remarks>
        /// <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="PaneBase"/> 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>
        public override void Draw(Graphics g, PaneBase pane, float scaleFactor)
        {
            // Convert the arrow coordinates from the user coordinate system
            // to the screen coordinate system
            PointF pix1 = Location.TransformTopLeft(pane);
            PointF pix2 = Location.TransformBottomRight(pane);

            if (pix1.X > -10000 && pix1.X < 100000 && pix1.Y > -100000 && pix1.Y < 100000 &&
                pix2.X > -10000 && pix2.X < 100000 && pix2.Y > -100000 && pix2.Y < 100000)
            {
                // calculate the length and the angle of the arrow "vector"
                double dy = pix2.Y - pix1.Y;
                double dx = pix2.X - pix1.X;
                float angle = (float) Math.Atan2(dy, dx)*180.0F/(float) Math.PI;
                var length = (float) Math.Sqrt(dx*dx + dy*dy);

                // Save the old transform matrix
                Matrix transform = g.Transform;
                // Move the coordinate system so it is located at the starting point
                // of this arrow
                g.TranslateTransform(pix1.X, pix1.Y);
                // Rotate the coordinate system according to the angle of this arrow
                // about the starting point
                g.RotateTransform(angle);

                // get a pen according to this arrow properties
                using (var pen = new Pen(_color, pane.ScaledPenWidth(_penWidth, scaleFactor)))
                {
                    pen.DashStyle = _style;

                    g.DrawLine(pen, 0, 0, length, 0);
                }

                // Restore the transform matrix back to its original state
                g.Transform = transform;
            }
        }
开发者ID:apravdivy,项目名称:MagistrSolution,代码行数:58,代码来源:LineObj.cs


示例14: Draw

		/// <summary>
		/// Render this object to the specified <see cref="Graphics"/> device.
		/// </summary>
		/// <remarks>
		/// This method is normally only called by the Draw method
		/// of the parent <see cref="GraphObjList"/> collection object.
		/// </remarks>
		/// <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="PaneBase"/> 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>
		override public void Draw( Graphics g, PaneBase pane, float scaleFactor )
		{
			// Convert the arrow coordinates from the user coordinate system
			// to the screen coordinate system
			RectangleF pixRect = this.Location.TransformRect( pane );

			// Clip the rect to just outside the PaneRect so we don't end up with wild coordinates.
			RectangleF tmpRect = pane.Rect;
			tmpRect.Inflate( 20, 20 );
			pixRect.Intersect( tmpRect );

			if (	Math.Abs( pixRect.Left ) < 100000 &&
					Math.Abs( pixRect.Top ) < 100000 &&
					Math.Abs( pixRect.Right ) < 100000 &&
					Math.Abs( pixRect.Bottom ) < 100000 )
			{
				// If the box is to be filled, fill it
				_fill.Draw( g, pixRect );
				
				// Draw the border around the box if required
				_border.Draw( g, pane, scaleFactor, pixRect );
			}
		}
开发者ID:RobertCL,项目名称:MissionPlanner,代码行数:44,代码来源:BoxObj.cs


示例15: PointInBox

        /// <summary>
        /// Determine if the specified screen point lies inside the bounding box of this
        /// <see cref="PolyObj"/>.
        /// </summary>
        /// <param name="pt">The screen point, in pixels</param>
        /// <param name="pane">
        /// A reference to the <see cref="PaneBase"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <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="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>
        /// <returns>true if the point lies in the bounding box, false otherwise</returns>
        override public bool PointInBox( PointF pt, PaneBase pane, Graphics g, float scaleFactor )
        {
            if ( _points != null && _points.Length > 1 )
            {
                if ( ! base.PointInBox(pt, pane, g, scaleFactor ) )
                    return false;

                using ( GraphicsPath path = MakePath( pane ) )
                    return path.IsVisible( pt );
            }
            else
                return false;
        }
开发者ID:RFExplorer,项目名称:rfexplorer-1,代码行数:33,代码来源:PolyObj.cs


示例16: PointInBox

		/// <summary>
		/// Determine if the specified screen point lies inside the bounding box of this
		/// <see cref="BoxObj"/>.
		/// </summary>
		/// <param name="pt">The screen point, in pixels</param>
		/// <param name="pane">
		/// A reference to the <see cref="PaneBase"/> object that is the parent or
		/// owner of this object.
		/// </param>
		/// <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="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>
		/// <returns>true if the point lies in the bounding box, false otherwise</returns>
		override public bool PointInBox( PointF pt, PaneBase pane, Graphics g, float scaleFactor )
		{
			if ( ! base.PointInBox(pt, pane, g, scaleFactor ) )
				return false;

			// transform the x,y location from the user-defined
			// coordinate frame to the screen pixel location
			RectangleF pixRect = _location.TransformRect( pane );

			return pixRect.Contains( pt );
		}
开发者ID:RobertCL,项目名称:MissionPlanner,代码行数:31,代码来源:BoxObj.cs


示例17: PaneBase

		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see cref="PaneBase"/> object from which to copy</param>
		public PaneBase( PaneBase rhs )
		{
			// copy over all the value types
			_isFontsScaled = rhs._isFontsScaled;
			_isPenWidthScaled = rhs._isPenWidthScaled;

			_titleGap = rhs._titleGap;
			_baseDimension = rhs._baseDimension;
			_margin = rhs._margin.Clone();
			_rect = rhs._rect;

			// Copy the reference types by cloning
			_fill = rhs._fill.Clone();
			_border = rhs._border.Clone();
			_title = rhs._title.Clone();

			_legend = rhs.Legend.Clone();
			_title = rhs._title.Clone();
			_graphObjList = rhs._graphObjList.Clone();
			
			if ( rhs._tag is ICloneable )
				_tag = ((ICloneable) rhs._tag).Clone();
			else
				_tag = rhs._tag;
		}
开发者ID:CraigElder,项目名称:MissionPlanner,代码行数:29,代码来源:PaneBase.cs


示例18: Draw

        /// <summary>
        /// Render this <see cref="TextObj"/> object to the specified <see cref="Graphics"/> device
        /// This method is normally only called by the Draw method
        /// of the parent <see cref="GraphObjList"/> collection object.
        /// </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="PaneBase"/> 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>
        public override void Draw( Graphics g, PaneBase pane, float scaleFactor )
        {
            // transform the x,y location from the user-defined
            // coordinate frame to the screen pixel location
            PointF pix = _location.Transform( pane );

            // Draw the text on the screen, including any frame and background
            // fill elements
            if ( pix.X > -100000 && pix.X < 100000 && pix.Y > -100000 && pix.Y < 100000 )
            {
                //if ( this.layoutSize.IsEmpty )
                //	this.FontSpec.Draw( g, pane.IsPenWidthScaled, this.text, pix.X, pix.Y,
                //		this.location.AlignH, this.location.AlignV, scaleFactor );
                //else
                    this.FontSpec.Draw( g, pane, _text, pix.X, pix.Y,
                        _location.AlignH, _location.AlignV, scaleFactor, _layoutArea );

            }
        }
开发者ID:viwhi1,项目名称:TDMaker,代码行数:38,代码来源:TextObj.cs


示例19: Draw

        /// <summary>
        /// Render this object to the specified <see cref="Graphics"/> device.
        /// </summary>
        /// <remarks>
        /// This method is normally only called by the Draw method
        /// of the parent <see cref="GraphObjList"/> collection object.
        /// </remarks>
        /// <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="PaneBase"/> 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>
        public override void Draw( Graphics g, PaneBase pane, float scaleFactor )
        {
            // Convert the arrow coordinates from the user coordinate system
            // to the screen coordinate system
            RectangleF pixRect = this.Location.TransformRect( pane );

            if (	Math.Abs( pixRect.Left ) < 100000 &&
                    Math.Abs( pixRect.Top ) < 100000 &&
                    Math.Abs( pixRect.Right ) < 100000 &&
                    Math.Abs( pixRect.Bottom ) < 100000 )
            {
                if ( _fill.IsVisible )
                    using ( Brush brush = _fill.MakeBrush( pixRect ) )
                        g.FillEllipse( brush, pixRect );

                if ( _border.IsVisible )
                    using ( Pen pen = _border.GetPen( pane, scaleFactor ) )
                        g.DrawEllipse( pen, pixRect );
            }
        }
开发者ID:Rupan,项目名称:BDInfo,代码行数:41,代码来源:EllipseObj.cs


示例20: PointInBox

        /// <summary>
        /// Determine if the specified screen point lies inside the bounding box of this
        /// <see cref="TextObj"/>.  This method takes into account rotation and alignment
        /// parameters of the text, as specified in the <see cref="FontSpec"/>.
        /// </summary>
        /// <param name="pt">The screen point, in pixels</param>
        /// <param name="pane">
        /// A reference to the <see cref="PaneBase"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <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="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>
        /// <returns>true if the point lies in the bounding box, false otherwise</returns>
        public override bool PointInBox( PointF pt, PaneBase pane, Graphics g, float scaleFactor )
        {
            if ( ! base.PointInBox(pt, pane, g, scaleFactor ) )
                return false;

            // transform the x,y location from the user-defined
            // coordinate frame to the screen pixel location
            PointF pix = _location.Transform( pane );

            return _fontSpec.PointInBox( pt, g, _text, pix.X, pix.Y,
                                _location.AlignH, _location.AlignV, scaleFactor, this.LayoutArea );
        }
开发者ID:viwhi1,项目名称:TDMaker,代码行数:33,代码来源:TextObj.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ZedGraph.PointPair类代码示例发布时间:2022-05-26
下一篇:
C# ZedGraph.MasterPane类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap