J2ME is bare-bones and I recently realised that it doesn’t have any image encoders. Sure, you can create Image
objects… but there is no way to persist them to disc or to send them over the network in a recognised format.
With the goal of creating a low-memory PNG encoder based on TinyLine GZIPInputStream,I wrote an uncompressed BMP encoder as a gentle introduction. I amposting it here (under the LGPL) incase it helps somebody out… I gottripped up by some file format details (including Endianness) so you don’t need to go through it.
Unfortunately, you won’t be able to load BMPs and display them without writing your own decoder! (J2ME only supports PNG)… but at least it allows you to communicate images with the outside world.
One of the biggest problems with J2ME is that there aren’t any greatopen source librarIEs out there. That’s one of Java’s greateststrengths. I intend to post a few of my J2ME utility classes here as Iwrite them. I’m currently working on a hobby project which I intend torelease here, and if it goes according to plan, I intend to reveal somebluetooth convenIEnce classes.
/* * Copyright ThinkTank Mathematics Limited 2007 * * This file is free software