|
Author |
Topic: image() throws exception in 0054 (Read 269 times) |
|
fli
|
image() throws exception in 0054
« on: May 19th, 2003, 4:12pm » |
|
When I try to display a BImage using image(), I get the following exception: <pre> java.lang.ArrayIndexOutOfBoundsException: 1072693248 at BPolygon.scanline(BPolygon.java:31 at BPolygon.render(BPolygon.java:20 at BGraphics.endShape(BGraphics.java:116 at BGraphics.image(BGraphics.java:2413) at BGraphics.image(BGraphics.java:2363) at BApplet.image(BApplet.java:158 at Encounters$PhotoNode.paintRollover(Encounters.java:239) at Node.paint(Node.java:187) at Encounters.loop(Encounters.java:102) at BApplet.nextFrame(BApplet.java:267) at BApplet.run(BApplet.java:225) at java.lang.Thread.run(Thread.java:554) </pre> Code snippets: <pre> . . . BImage img = loadImage(p.getUrl(Photo.SIZE_S)); . . . image(img, 0, 0); . . . </pre> Even though it is undocumented, it does work to load an image from a URL. If I print out the width and height of the BImage, it displays the correct values. For now, I've worked around this by writing my own method that writes the pixels directly from the pixels[] array using setPixel (which is fine for me, since I don't want it transformed in any way). Francis (ps how do I post pre-formatted text?)
|
|
|
|
fry
|
Re: image() throws exception in 0054
« Reply #1 on: May 20th, 2003, 7:06pm » |
|
could you post a .zip of your sketch (folder) that's doing this? this could be a couple of different things.. code can go inside [ code ] and [ / code ] (remove the extra spaces to make that work. thanks to someone else who had to explain that to me as well
|
|
|
|
fli
|
Re: image() throws exception in 0054
« Reply #2 on: May 29th, 2003, 10:05am » |
|
I'm no longer working within the P5 development environment, but just using the graphics APIs. You can see the applet I was working on here: http://conncomm.interaction-ivrea.it:8080/theoryengine/code/encounters/ The source is a bit of a mess, but you can view it on the page. There's a lot of additional classes that I haven't posted the source for yet. I'll give the image() function another try in 0055 and see if it still is a problem. Francis
|
|
|
|
fry
|
Re: image() throws exception in 0054
« Reply #3 on: Sep 18th, 2003, 4:39am » |
|
i think this has been repaired in recent releases.
|
|
|
|
|