11.4. Creating and Using Images

11.4.1. Immutable Images

Images in a MIDP implementation may be either immutable or mutable. Immutable Images can be created directly from resource files, binary data, RGB data, or other Images. Once created, the contents of an immutable Image cannot be changed.

  • The Image.createImage(String name) method is used to create an immutable Image from binary data in a resource file bundled with the application in the application's JAR file. The name must begin with “/” and include the full name of the binary file within the JAR file.

  • The Image.createImage(byte[], int offset, int length) method is used to create an immutable Image from binary data contained in a byte array.

  • The Image.createImage(Image image) method is used ...

Get Programming Wireless Devices with the Java™ 2 Platform, Micro Edition, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.