在网络浏览器中的网格上绘制矩形

发布于 2024-08-25 08:10:55 字数 243 浏览 5 评论 0原文

我想创建一个在线、简单的所见即所得绘图编辑器,允许人们绘制矩形形状。我正在考虑一个网格,线条和点可以捕捉到该网格,确保线条严格垂直或水平。 我将解析矩形形状以获得一些面积计算并计算某些东西。 怎样才能达到绘画能力呢?新的 canvas 标签很好,但人们一直告诉我 IE 不支持它。我发现了一些 Java 小程序,但我以前从未用 Java 编程过。有没有办法使用纯 javascript 或 jquery 来做到这一点? ASP.NET 有帮助吗?

谢谢。

I would like to create an online, simple WYSIWYG drawing editor allowing people to draw rectangular shapes. I'm thinking of a grid which the lines and points can snap on to, ensuring that the lines are strictly vertical or horizontal.
I will be parsing the rectangular shapes to obtain some area calculations and compute certain things.
How can I achieve the drawing ability? The new canvas tag is good but people have been telling me that IE does not support it. I found some Java applets but I have never programmed in Java before. Is there a way to do this using pure javascript or jquery? Does ASP.NET help at all?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

忱杏 2024-09-01 08:10:55

你最好的选择绝对是学习 flash 或 silverlight。尝试用普通的旧 html / javascript 来做到这一点将是一个巨大的 PITA...如果你能让它工作的话。

You're absolute best bet is to learn flash or silverlight. Trying to do this in plain old html / javascript is going to be a huge PITA... if you even get it working.

岁月染过的梦 2024-09-01 08:10:55

对于垂直和水平线,您可以简单地使用带有背景、定义大小和绝对位置的细 div。编码非常简单,并且可以在任何地方使用。不过,除了严格的垂直/水平画布之外,您还需要画布。

For vertical and horizontal lines you can simply use thin divs with a background, defined size and absolute position. Really simple to code and will work everywhere. You'd need canvas for anything more than strictly vertical/horizontal ones though.

强者自强 2024-09-01 08:10:55

您绝对可以使用画布,并使用以下库之一在 IE 上模拟它:
http://code.google.com/p/gwt-canvas/< br>
http://excanvas.sourceforge.net/
但要注意性能。
克里斯·莱弗利说得有道理。

You can definetly use canvas, and emulate it on IE with one of the libs:
http://code.google.com/p/gwt-canvas/
http://excanvas.sourceforge.net/
But take care on performance.
Chris Lively has a point.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文