Java:无需awt即可创建图形?
是否有任何库可以在不使用 AWT 的情况下创建图形?
我需要的是简单的绘图函数(如画线)和文本绘图函数,以便在内存中为 Google 应用程序引擎应用程序创建图形。应用程序引擎不支持 AWT。
谢谢!
Is there any library out there to create graphics without using AWT?
What I need is simple drawing functions (like to draw a line) and text drawing functions to create graphics in memory for a Google app engine application. App engine does not support AWT.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
除非您想实现自己的图像类(例如位图)和线条、形状、图像的渲染算法。
如果您有计算机图形和光栅化方面的经验,这可能不是很难,但否则会超出您的想象。
Not unless you want to implement your own image class (say, a bitmap) and rendering algorithms for lines, shapes, images.
If you have experience with computer graphics and rasterization, this may not be very hard, but otherwise it will be more than you want to bite off.
您也可以尝试 appengine-awt 项目,尽管它还处于实验阶段。
You might also try the appengine-awt project, though it's a bit experimental.
您可以尝试使用 SenseLan。在要求部分中,它说他们不使用awt或ImageIO。当然,还有Images api,但它的功能似乎相当有限它提供。
编辑:
看起来有几种 Python 可能性可以为您提供一些有限的绘图功能。您可以将适当的图像功能编写为 python Web 服务,并将应用程序的其余部分保留在 Java 中
You might try using SenseLan. In the requirements section, it says they don't use awt or ImageIO. Of course, there is the Images api but it seems fairly limited in what it offers.
Edit:
It looks like there are a couple of Python possibilities that could offer you some limited drawing capabilities. You could probably write appropriate image functionality as python web services, and keep the rest of the app in Java:
使用 Batik for GAE,它可作为 FOP 对 GAE 的依赖项使用。
您还可以在 Google 应用引擎错误跟踪器 其他人在评论中分享了其他想法。
Use Batik for GAE which is available as a dependency of FOP on GAE.
You can also track the issue further on the Google app engine bug tracker where others have shared other ideas in the comments.
“Java 2D API 是一组用于高级 2D 图形和成像的类,包括线条艺术、文本和图像”
http://java.sun.com/products/java-media/ 2D/index.jsp
这是另一种可能性:org.eclipse.draw2d 它可能依赖于 eclipse SWT。
'The Java 2D API is a set of classes for advanced 2D graphics and imaging, encompassing line art, text, and images'
http://java.sun.com/products/java-media/2D/index.jsp
Here's another possibility: org.eclipse.draw2d It probably relies on eclipse SWT.
TinyLine 提供Google App Engine 服务器端的矢量图形支持,并且还提供 SVG 渲染支持。请参阅 SVG 缩略图演示。
TinyLine provides vector graphics support on the Google App Engine server side, and also provides SVG rendering support. See the SVG Thumbnail images demo.
Google Web Toolkit 包含一个漂亮的图形库,专为与 Google 应用程序引擎交互而设计。
编辑澄清:Google App Engine 专为在网络上托管应用程序而设计。您需要设计可以在浏览器中运行的图形。为此,您需要使用网络语言(例如 Javascript)编写代码。 Google Web Toolkit 包含一个可编译为 Javascript 的 Java 图形库,从而节省您自己编写 Javascript 的精力。
Google Web Toolkit contains a nice graphics library designed for interfacing with the Google app engine.
edit to clarify: Google App Engine is designed for hosting applications on the web. You need to design graphics that can run in the browser. To do this, you need to write code in a web language, Javascript, for example. Google Web Toolkit contains a Java graphics library which compiles down to Javascript, saving you the effort of writing the Javascript yourself.
我犹豫是否要提及 PJA,如果 AWT 类存在,它似乎可以工作,但安全性管理员阻止您使用它们。
I hesitate to mention PJA, which appears to work if the AWT classes are present, but the security manager prevents you from using them.
如果您可以在 GAE 上使用 Python 而不是 Java,那么就有 pybmp。
If you can use Python on GAE instead of Java, then there's pybmp.