简体   繁体   English

Java:创建没有awt的图形?

[英]Java: create graphics without awt?

Is there any library out there to create graphics without using AWT? 有没有使用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. 我需要的是简单的绘图功能(例如画一条线)和文本绘图功能,以在Google App Engine应用程序的内存中创建图形。 App engine does not support AWT. App引擎不支持AWT。

Thanks! 谢谢!

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 try using SenseLan . 您可以尝试使用SenseLan In the requirements section , it says they don't use awt or ImageIO. 需求部分 ,它说他们不使用awt或ImageIO。 Of course, there is the Images api but it seems fairly limited in what it offers. 当然,有Images API,但它提供的功能似乎相当有限。

Edit: 编辑:

It looks like there are a couple of Python possibilities that could offer you some limited drawing capabilities. 看起来有两种Python可能会为您提供一些有限的绘图功能。 You could probably write appropriate image functionality as python web services, and keep the rest of the app in Java: 您可能可以将适当的图像功能编写为python Web服务,并将应用程序的其余部分保留在Java中:

  1. Replacing Functionality of PIL (ImageDraw) in Google App Engine (GAE) 在Google App Engine(GAE)中替换PIL(ImageDraw)的功能
  2. http://denislaprise.com/2008/08/21/drawing-images-on-google-app-engine/ http://denislaprise.com/2008/08/21/drawing-images-on-google-app-engine/

Use Batik for GAE which is available as a dependency of FOP on GAE. 蜡染布用于GAE ,可以作为FOP对GAE的依赖项获得。

You can also track the issue further on the Google app engine bug tracker where others have shared other ideas in the comments. 您还可以在Google App引擎错误跟踪器上进一步跟踪问题,其他人在评论中分享了其他想法。

'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 “ Java 2D API是一组用于高级2D图形和图像的类,其中包括艺术线条,文本和图像” http://java.sun.com/products/java-media/2D/index.jsp

Here's another possibility: org.eclipse.draw2d It probably relies on eclipse SWT. 这是另一种可能性:org.eclipse.draw2d它可能依赖于Eclipse SWT。

TinyLine provides vector graphics support on the Google App Engine server side, and also provides SVG rendering support. TinyLine在Google App Engine服务器端提供矢量图形支持 ,还提供SVG渲染支持。 See the SVG Thumbnail images demo. 请参阅SVG缩略图图像演示。

Google Web Toolkit contains a nice graphics library designed for interfacing with the Google app engine. Google Web Toolkit包含一个漂亮的图形库,旨在与Google App引擎接口。

edit to clarify: Google App Engine is designed for hosting applications on the web. 编辑以澄清:Google App Engine是为在网络上托管应用程序而设计的。 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. 为此,您需要使用Web语言(例如Javascript)编写代码。 Google Web Toolkit contains a Java graphics library which compiles down to Javascript, saving you the effort of writing the Javascript yourself. Google Web Toolkit包含一个Java图形库,该库可编译为Javascript,从而省去了自己编写Javascript的工作。

我很犹豫地提到PJA ,如果存在AWT类,它似乎可以工作,但是安全管理器阻止您使用它们。

如果您可以在GAE上使用Python而不是Java,那么可以使用pybmp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM