當前位置: 首頁>>代碼示例>>C#>>正文


C# GraphPane.ReverseTransform方法代碼示例

本文整理匯總了C#中SkyDean.FareLiz.WinForm.Components.Controls.Graph.GraphPane.ReverseTransform方法的典型用法代碼示例。如果您正苦於以下問題:C# GraphPane.ReverseTransform方法的具體用法?C# GraphPane.ReverseTransform怎麽用?C# GraphPane.ReverseTransform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SkyDean.FareLiz.WinForm.Components.Controls.Graph.GraphPane的用法示例。


在下文中一共展示了GraphPane.ReverseTransform方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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 (this._isEnableHZoom)
            {
                this.ZoomScale(pane.XAxis, zoomFraction, x, isZoomOnCenter);
                this.ZoomScale(pane.X2Axis, zoomFraction, x2, isZoomOnCenter);
            }

            if (this._isEnableVZoom)
            {
                for (int i = 0; i < pane.YAxisList.Count; i++)
                {
                    this.ZoomScale(pane.YAxisList[i], zoomFraction, y[i], isZoomOnCenter);
                }

                for (int i = 0; i < pane.Y2AxisList.Count; i++)
                {
                    this.ZoomScale(pane.Y2AxisList[i], zoomFraction, y2[i], isZoomOnCenter);
                }
            }

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

                // g.Dispose();
            }

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

            if (isRefresh)
            {
                this.Refresh();
            }
        }
開發者ID:tu-tran,項目名稱:FareLiz,代碼行數:69,代碼來源:ZedGraphControl.Events.cs


注:本文中的SkyDean.FareLiz.WinForm.Components.Controls.Graph.GraphPane.ReverseTransform方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。