Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ImageItems - immutable images

 
John Mitchell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
John Mitchell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok update to this problem....the code works on the Palm emulator using the m500 ROM - but doesn't work using the m505 ROM or on the real m550 (Tungsten) device.
Anybody come across the before, or can suggest a solution?
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic