Flex 中的无限画布
我正在使用 Flex 开发一个网络应用程序。该应用程序允许在 Canvas 中绘制表单(如 Windows 中的 MSPaint)。
现在,我想要一个新功能:无限的画布。用户应该能够拖动主画布,并且 X 轴和 Y 轴应该是无限的。因此,该 Canvas 应该实时调整大小。
显然,我不想创建一个 1k x 1k 像素的 Canvas,并在特定区域进行缩放,以给出无限绘图区域的感觉。
我怎样才能实现它?欢迎任何建议或想法:)
编辑:
我刚刚读到 Flash/Flex Flash/Air 支持高达 4056x4056 像素的画布,而不是无限的。
I'm developing a web app using Flex. This app allows to draw forms in a Canvas (like MSPaint in Windows).
Now, I want a new feature on it: an infinite canvas. The user should be able to drag the main Canvas and this should be infinite in X and Y axis. Consecuently, this Canvas should be resized in real time.
Obviously, I don't want to create a Canvas of 1k x 1k pixels with zoom in an specific area to give the feeling of an infinite drawing area.
How could I achieve it? Any suggestions or ideas are welcome :)
EDIT:
I just read that Flash/Flex Flash/Air supports canvases up to 4056x4056 px, not infinite.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要重新考虑如何实现无限画布 - 单个不断增长的画布可能会导致性能问题。
相反,请考虑将画布分成固定大小的虚拟画布(我建议比最大的 4056x4056 小得多),然后在运行时当用户平移时将它们缝合在一起。
You might want to reconsider how you implement your infinite canvas - a single, ever growing canvas, is likely to cause performance issues.
Instead, consider breaking your canvas into virtual canvases of fixed size (I'd recommend much smaller than the max of 4056x4056), and then stitch them together at runtime, as the user pans around.