×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    65

    How to retrieve images from the resource file?

    How to retrieve images from the resource file of the current theme?

    This is pretty trivial for experienced J2ME developer, but I couldn't google myself an answer. Could some one point me to the right direction?
    Last edited by imgen; 2013-05-23 at 11:28.

  2. #2
    Registered User
    Join Date
    Mar 2013
    Location
    United Kingdom
    Posts
    161

    Re: How to retrieve images from the resource file?

    Quote Originally Posted by imgen View Post
    How to retrieve images from the resource file of the current theme?

    This is pretty trivial for experienced J2ME developer, but I couldn't google myself an answer. Could some one point me to the right direction?
    Assuming you have a folder called res with an image of the following name (image.png), the following code should work.

    Code:
        private final Image loadImage()
            throws IOException
        {
            try {
                image = Image.createImage("/image.png");
            }
            catch (IOException ioe) {
                ioe.printStackTrace();
            }
            
            return image;
        }

  3. #3
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    284

    Re: How to retrieve images from the resource file?

    Standard J2ME has no themes. Do you mean in LWUIT?

  4. #4
    Registered User
    Join Date
    Apr 2013
    Posts
    65

    Re: How to retrieve images from the resource file?

    Yes, LWUIT was what I meant. Sorry for not make it clear. I know how to retrieve images using Image.createImage though. Just don't know the alternative methods of using the theme file (.res file).
    Last edited by imgen; 2013-05-24 at 03:20.

Similar Threads

  1. Replies: 5
    Last Post: 2010-12-10, 11:03
  2. [moved] Store and retrieve Images
    By Fye_08 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 10
    Last Post: 2009-02-26, 16:07
  3. Retrieve images' names from photo album
    By lazmous in forum Symbian
    Replies: 3
    Last Post: 2005-07-29, 05:37
  4. Replies: 0
    Last Post: 2004-07-18, 17:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×