使用c#在Web应用程序中绘制线条
问题描述:
他们以任何方式在Windows应用程序等网站上划线吗?
Is their any way to draw lines into websites like windows applications?
答
可以有不同的方法,但不是很多。可能你不是指Java applet,Flash或Silverlight方法,这可能会给你最灵活的技术。
首先,你可以用图像完成所有工作。您的ASP.NET应用程序可以动态创建映像(使用System.Drawing
)并将其发送回HTTP响应(请参阅MDSN文章中的代码示例System.Web.HttpResponse
: http:/ /msdn.microsoft.com/en-us/library/system.web.httpresponse.aspx [ ^ ];这将涉及相当大的性能成本。)
另一种方法可以使用客户端代码,基于HTML5 canvas 。请参阅,例如: https://developer.mozilla.org/en-US/ docs / Web / Guide / HTML / Canvas_tutorial [ ^ ]。-SA
There can be different approaches, but not many. Probably you don't mean Java applet, Flash or Silverlight approaches, which would probably give you most flexible techniques.
First, you could do it all with images. Your ASP.NET application can create image on the fly (usingSystem.Drawing
) and send them back in HTTP response (please see the code sample in the MDSN article onSystem.Web.HttpResponse
: http://msdn.microsoft.com/en-us/library/system.web.httpresponse.aspx[^]; it will involve considerable performance cost).
Another approach could use client-side code and is based on HTML5 canvas. Please see, for example: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial[^].—SA
最好的要做的就是使用一些javascript库。有许多javascript库是为了绘制应用程序而构建的。它们对您来说更容易,在客户端也更轻巧。你可以查看Yahoo UI;更好的谷歌,并选择最适合您的要求。
The best way to do is to use some javascript library. There are lots of javascript libraries which are build with the purpose of drawing application in mind. They will be easier for you as well as lightweight on the client end. You can check Yahoo UI; better google for them and select the one which best suits your requirements.
the-basics-of-drawing-graphics-to-windows-forms / [ ^ ]
希望它会有所帮助......
the-basics-of-drawing-graphics-onto-windows-forms/[^]
Hope it will help..