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


C# GraphPane.ReverseTransform方法代码示例

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


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

示例1: ZoomPane

        /// <summary>
        /// Zoom a specified pane in or out according to the specified zoom fraction.
        /// </summary>
        /// <remarks>
        /// The zoom will occur on the <see cref="XAxis" />, <see cref="YAxis" />, and
        /// <see cref="Y2Axis" /> only if the corresponding flag, <see cref="IsEnableHZoom" /> or
        /// <see cref="IsEnableVZoom" />, is true.  Note that if there are multiple Y or Y2 axes, all of
        /// them will be zoomed.
        /// </remarks>
        /// <param name="pane">The <see cref="GraphPane" /> instance to be zoomed.</param>
        /// <param name="zoomFraction">The fraction by which to zoom, less than 1 to zoom in, greater than
        /// 1 to zoom out.  For example, 0.9 will zoom in such that the scale is 90% of what it was
        /// originally.</param>
        /// <param name="centerPt">The screen position about which the zoom will be centered.  This
        /// value is only used if <see paramref="isZoomOnCenter" /> is true.
        /// </param>
        /// <param name="isZoomOnCenter">true to cause the zoom to be centered on the point
        /// <see paramref="centerPt" />, false to center on the <see cref="Chart.Rect" />.
        /// </param>
        /// <param name="isRefresh">true to force a refresh of the control, false to leave it unrefreshed</param>
        protected void ZoomPane(GraphPane pane, double zoomFraction, PointF centerPt,
            bool isZoomOnCenter, bool isRefresh)
        {
            double x;
            double x2;
            double[] y;
            double[] y2;

            pane.ReverseTransform(centerPt, out x, out x2, out y, out y2);

            if (_isEnableHZoom) {
                ZoomScale(pane.XAxis, zoomFraction, x, isZoomOnCenter);
                ZoomScale(pane.X2Axis, zoomFraction, x2, isZoomOnCenter);
            }
            if (_isEnableVZoom) {
                for (int i = 0; i < pane.YAxisList.Count; i++)
                    ZoomScale(pane.YAxisList[i], zoomFraction, y[i], isZoomOnCenter);
                for (int i = 0; i < pane.Y2AxisList.Count; i++)
                    ZoomScale(pane.Y2AxisList[i], zoomFraction, y2[i], isZoomOnCenter);
            }

            using (Graphics g = this.CreateGraphics()) {
                pane.AxisChange(g);
                //g.Dispose();
            }

            this.SetScroll(this.hScrollBar1, pane.XAxis, _xScrollRange.Min, _xScrollRange.Max);
            this.SetScroll(this.vScrollBar1, pane.YAxis, _yScrollRangeList[0].Min,
                           _yScrollRangeList[0].Max);

            if (isRefresh)
                Refresh();
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:53,代码来源:ZedGraphControl.Events.cs

示例2: z1_CursorValueEvent

 private string z1_CursorValueEvent( ZedGraphControl z1, GraphPane pane, Point mousePt )
 {
     double x, y;
     pane.ReverseTransform( mousePt, out x, out y );
     return "( " + x.ToString( "f2" ) + ", " + y.ToString( "f2" ) + " )";
 }
开发者ID:Jungwon,项目名称:ZedGraph,代码行数:6,代码来源:Form1.cs

示例3: DoDrag

        public bool DoDrag(GraphPane graphPane, PointF pt)
        {
            // Calculate new location of boundary from mouse position
            double time, yTemp;
            graphPane.ReverseTransform(pt, out time, out yTemp);

            bool changed = false;
            foreach (var dragInfo in _peakBoundDragInfos)
            {
                if (dragInfo.MoveTo(pt, time, IsMultiGroup,
                    (startTime, endTime) => FindMaxPeakItem(graphPane, startTime, endTime)))
                    changed = true;
            }
            return changed;
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:15,代码来源:GraphChromatogram.cs

示例4: FindBestPeakTime

        private ScaledRetentionTime FindBestPeakTime(GraphPane graphPane, CurveItem curve, PointF pt, out ChromGraphItem graphItem)
        {
            graphItem = FindBestPeakItem(curve);
            if (graphItem != null)
            {
                double displayTime, yTemp;
                graphPane.ReverseTransform(pt, out displayTime, out yTemp);
                return graphItem.GetNearestDisplayTime(displayTime);
            }

            return ScaledRetentionTime.ZERO;
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:12,代码来源:GraphChromatogram.cs

示例5: FindBestPeakBoundary

        private ScaledRetentionTime FindBestPeakBoundary(PointF pt, out GraphPane graphPane, out ChromGraphItem graphItem)
        {
            double deltaBest = double.MaxValue;
            ScaledRetentionTime timeBest = ScaledRetentionTime.ZERO;
            graphItem = null;
            ChromGraphItem graphItemBest = null;
            graphPane = GraphPaneFromPoint(pt);
            if (null != graphPane)
            {
                double time, yTemp;
                graphPane.ReverseTransform(pt, out time, out yTemp);

                foreach (var graphItemNext in GetGraphItems(graphPane))
                {
                    var transitionChromInfo = graphItemNext.TransitionChromInfo;
                    if (transitionChromInfo == null)
                    {
                        continue;
                    }
                    var timeMatch = graphItemNext.GetNearestBestPeakBoundary(time);
                    if (!timeMatch.IsZero)
                    {
                        double delta = Math.Abs(time - timeMatch.DisplayTime);
                        if (delta < deltaBest)
                        {
                            deltaBest = delta;
                            timeBest = timeMatch;
                            graphItemBest = graphItemNext;
                        }
                    }
                }

                // Only match if the best time is close enough in absolute pixels
                if (graphItemBest != null && Math.Abs(pt.X - graphPane.XAxis.Scale.Transform(timeBest.DisplayTime)) > 3)
                    graphItemBest = null;

                graphItem = graphItemBest;
            }
            if (graphItem == null)
            {
                return ScaledRetentionTime.ZERO;
            }
            return timeBest;
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:44,代码来源:GraphChromatogram.cs

示例6: zGraph_CursorValueEvent

 private string zGraph_CursorValueEvent(ZedGraphControl sender, GraphPane pane, Point mousePt)
 {
     double x, y;
     pane.ReverseTransform(mousePt, out x, out y);
     return string.Format("X={0} Y={1}", ((XDate)x).ToString("mm:ss"), y);
 }
开发者ID:Kelvin312,项目名称:KRT_Graph,代码行数:6,代码来源:GraphLayer.cs


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