问题描述
大家好,
我已经搜索了这个问题的答案已有一段时间了.返回到Code Project上一些非常好的,有点相关的问答之后,我想我终于可以在这里发布并交叉手指以寻求合适的答案.
在中断了10年之后,我最近又回到了一些使用VB + WPF进行业余编码的过程,该编码来自Delphi/Pascal背景.
我将使用一个非常简化的示例说明我要实现的目标.实际上,我需要的是滚动垂直图.这需要是一个一致的页面(不要像文字处理程序那样分成多个页面).可以说屏幕高度代表60分钟,但是文档本身可能会滚动几天的数据.此应用程序在此缩放图的两侧还会有一些空格,可能会让用户将文本注释输入到可移动文本框中(每个注释在单独的文本框中,分别与给定时间对齐).用户还可以单击/添加该图上的其他几个图形元素.
我的问题是,我绝对不知道该从哪里开始.我对如何正确绘制此滚动图感到困惑不解,因为它长很多页.上下移动每次都重新绘制数据元素对我来说似乎不是解决方案.我绝对坚持这一点.我可以实现各种静态的标准事物,并且仅限于我在屏幕上看到的事物.我最近在图形模块上做了漂亮的三次样条.但是同样,这些行都没有离开页面.所提供的任何帮助将不胜感激.我希望看到一些简单的代码,显示带有形状/线条/文本的长滚动页面.目前,我坚信以3D绘制场景比尝试了解这一点要容易得多.
在此先感谢您,我将随时回答您所提出的任何问题.
标记
Hi everyone,
I have searched for an answer to this question for some time. After returning to some very good, somewhat related, Q&A here on Code Project, I thought I would finally post here and cross my fingers for a suitable answer.
I am recently returning to some amateur coding using VB+WPF after a 10 year hiatus and coming from Delphi/Pascal background.
I will use a very simplified example of what I am trying to implement. What I need is essentially a scrolling vertical graph. This needs to be a consistent page(not broken into pages like a word processor). Lets say the height of the screen would represent 60 min, but the document itself may scroll for days worth of data. This application would also have some whitespace to either side of this scaled graph that may have the user input text comments into a movable text box(each comment in a separate text box, that is separately aligned with a given time).There may be a few other graphical elements along this graph as well that user can click/add.
My problem here is that I am absolutely lost on where to start with this. I am thoroughly confused by how to properly draw this scrolling graph so that it is many many pages long. redrawing the data elements with each move up or down does not seem like the solution to me. I am absolutely stuck on this. I can implement all sorts of standard things that are static and limited to what I see on the screen. I recently did a nice cubic spline on a graphic module. But again, none of those lines leave the page. ANY help that is offered will be very much appreciated. I would love to see some simple code showing a long scrolling page with shapes/lines/text. At the moment, I am convinced it would be much easier to draw a scene in 3D than to try an get this understood.
Thanks in advance and I will be watching to answer any questions asked.
Mark
推荐答案
这篇关于如何在VB/WPF中绘制单个滚动多页图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!