posted 21 years ago
Hi there,
I've been having a few problems creating ImageItems in MIDP applications. The way I'm the image is using the following code:
Image buffer = Image.createImage(width,height);
Graphics g = buffer.getGraphics()
//draw some stuff into the image here
Image actualImage = Image.createImage(buffer);
Now, as I understand it, the buffer is a mutable image, but the actualImage is an immutable image. Am I right there?
However, when I try using that image in a ImageItem using the code:
ImageItem imageItem = new ImageItem("",actualImage,ImageItem.LAYOUT_CENTER,"");
...it throws an IllegalArgumentException. Now, again as I understand it, that exception is thrown if the image is mutable or if the layout argument is invalid.
However, when I set the image argument to null, the program runs, but obviously doesn't display the image.
Having said that though, actualImage.isMutable() returns false.
I am bamboozled as to where I'm going wrong here. Any help would be appreciated.
Thanks