如何在WPF中绘制数字信号? [英] How to draw digital signal in WPF?

查看:203
本文介绍了如何在WPF中绘制数字信号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要绘制的数字信号,并能够将线路的每个部分在WPF

I need to draw digital signal and be able to move each part of the lines in WPF.

如下面的箭头图象表示向哪个方向线的部分可以移动。单击并拖动点击区域将移动整个广场左侧或右侧。

As shown in picture below the arrows indicate to which direction the part of the line can be moved. Clicking and dragging the "clickable area" will move the whole square left or right.

我想对夫妇的方式做到这一点:

I thought couple of ways to do it:

  1. 折线对象。但我无法控制线的每一个部分。
  2. 对象。在每一个变化都行应该调整自己的位置。难以控制的点击区域。或许也很复杂。
  3. 边框对象。每个部分实际上是一个边界,将显示/隐藏相应的边境一侧。我不知道如何容易使边界两侧移动。
  4. 在其他选项...
  1. Polyline object. But I cannot control each part of the line.
  2. Line object. On each change all lines should adjust their locations. Hard to control "clickable area". Maybe also complicated.
  3. Border object. Each section will actually be a border which will show/hide appropriate border side. I'm not sure how easy to make movable sides of the border.
  4. Other options...

我的问题是,什么是开始这样做了最正确的方法是什么?

My question is, what is the most correct way to start doing it?

推荐答案

一对夫妇的事情要考虑...

A couple of things to consider...

  • 拇指是一个很好的控制,从开始你拖动的东西,因为它已经提供了适当的事件,你可以处理移动它。通过模板化它,你可以给它任何你喜欢的形状。

  • a Thumb is a good control to start your draggable things from, as it already provides proper events you can handle to move it. By templating it you can give it any shape you like.

您可以通过巧妙使用电网和适当放置电网分离得到免费的可拖动线。如果不工作,然后4长方形可以很好地工作。你把它们放在一个 DockingPanel 与位置上,左,右,最后一个填充,你有足够的基元反应到所有需要的事件。

you may get draggable lines for free through clever use of a Grid and appropriately placed grid splitters. If that doesn't work then 4 rectangles could work well. You put them in a DockingPanel with placement top, left, right and the last one fill, and you have enough primitives to react to all desired events.

这篇关于如何在WPF中绘制数字信号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆