• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ImageItems - immutable images

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic