【问题标题】:How to create and use a ZoomRectangle in Oxyplot如何在 Oxyplot 中创建和使用 ZoomRectangle
【发布时间】:2015-04-14 08:55:20
【问题描述】:

我试图在按钮单击事件后显示 ZoomRectangle(固定大小和跟随鼠标),但我在文档中找不到任何内容。

有什么想法吗?

    OxyRect lens;
    private void button2_Click(object sender, EventArgs e)
    {
        lens = new OxyRect(0, 0, tempPlot.Width / 4, tempPlot.Height / 4);
        tempPlot.ShowZoomRectangle(lens);
        tempPlot.MouseMove += new System.Windows.Forms.MouseEventHandler(this.plot_MouseMove);
    }

    private void panelTemp_MouseMove(object sender, MouseEventArgs e)
    {
        lens.Left = e.X;
        lens.Top = e.Y;
    }

【问题讨论】:

    标签: c# winforms oxyplot


    【解决方案1】:

    抱歉,我没有足够的声誉以评论的形式对此发表评论。

    只是为了让您知道 OxyPlot 已经具有放大特定区域的功能。只需按住鼠标中键并将其拖到要放大的区域上即可。

    如果这不是您所追求的,并且您确实想要缩放矩形,您可以创建一个事件,使用鼠标位置将当前 X 和 Y 轴缩小一定量。

    鼠标位置可以通过鼠标事件从 PlotView 中获取,并且可以使用 InversedTransformation 获取绘图坐标。

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-22
      • 1970-01-01
      相关资源
      最近更新 更多