开发者

How to load images using loadImage the function

I am using jboss application server for deploying my app c开发者_如何学运维ontaining processing code.

My directory structure looks like this myapp-war-1.0.0.war\js\processing.js myapp-war-1.0.0.war\img\bird.png

myapp-ear-1.0.0\myapp-war-1.0.0.war\birds\bird.html

How to refer the image bird.png from bird.html

<script>
PImage img;
img =  loadImage("img\bird.png");
// The above code doesn't seem to work, but If I use an absolute path to a file in the file system, the processing IDE is able to pick it up.
image(img, 10, 10);
...

How should I look for this file in a relative fashion within my Java EE application packed in a EAR format.


you can try solve this by looking at the output of:

var jsCode = Processing.compile(txt).sourceCode; alert(jsCode);

where txt is the processing script code !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜