×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    103

    Thumbs down LWUIT Image-IOException

    I required to set the jpeg(jpg) image as background image of LWUIT form. It leads to an Exception at the image creating position----
    Image image=Image.createImage("path of the image");
    But, remaining images png, and gif are works fine. Pls, help me----
    How to create the Image object from jpg file?
    Note: jpg image may any dimension.

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: LWUIT Image-IOException

    Hi,
    I wonder if you can use the jpg images in J2ME,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    103

    Re: LWUIT Image-IOException

    Quote Originally Posted by raj_J2ME View Post
    Hi,
    I wonder if you can use the jpg images in J2ME,
    Yes, If we put those images in res folder of a project ,and specify the path, that works fine(for all images;any no of pixels).
    But, Using FileConnection some GIF and JPG images are works but some leads to an exception, some means which includes more no of pixels(like 5,119,91090 bytes).

    Isn't JPG image used in J2me? Pls, help me-----

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: LWUIT Image-IOException

    Hi,
    Read that what java docs says -
    Implementations must support all images formats that are supported in the underlying platform (for example, image-handling module). All implementations must support PNG (as mandated by MIDP specifications [MIDP1.0] and [MIDP2.0]), GIF (including animated GIFs), and JPEG (as mandated by the JTWI specification [JTWI]) formats). Animated GIFs must be supported if used through high-level APIs, that is, images in Form, List, and Alert. When animated GIF is used through a high-level API, the implementation will automatically present the animation.
    Images must be supported in a high-level API, that is, in List, Alert, and Form (ChoiceGroups, ImageItems). Implementations can choose whether the layout is dynamic based on image size or based on normal icon sizes for a given user interface style.
    Transparency support must be implemented as stated in MIDP 2.0 specifications. Based on image format capabilities, both simple palette transparency (for example, TRNs chunk of PNG) and alpha-channel-based transparency must be supported.
    Image transparency must be supported throughout the lcdui APIs (both high level and low level). For example, List elements in particular may have images with transparency information.
    Also, transparency must be supported when presenting images defined in MIDlet-n and MIDlet-icon attributes in JAD or manifest files. PNG is the only format that is supported in MIDlet-icon and MIDlet-n attributes.
    No hard-coded limitations must exist on supported image sizes. Many applications tend to use images that may be significantly larger than the size of a screen.
    Please check that whether these liens can help you,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    103

    Re: LWUIT Image-IOException

    Quote Originally Posted by raj_J2ME View Post
    Hi,
    Read that what java docs says -

    Please check that whether these liens can help you,
    Tank u for replying----
    But, Still I can't solve the existing problem.

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: LWUIT Image-IOException

    Hey,
    I have not worked with LWUIT,I have no idea about that whether jpg image can be loaded in J2ME..
    I guess can not be loaded using Netbeans IDE + WTK..
    Just you check on the google or search forum nokia..
    Sorry!!
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: LWUIT Image-IOException

    well maybe lwuit has an inbuilt jpeg software-decoder, it may be possible just like jappit's post on making a j2me gif decoder... all this whilst j2me officially doesnt support the format...
    still, I guess the best way to find out is to check lwuit's documentation ?

  8. #8
    Registered User
    Join Date
    Mar 2013
    Posts
    1

    Re: LWUIT Image-IOException

    background images are not binding to my forms when I use lwuit toolkit 1.0 although images on buttons binds okay. Whereas if I use lwuit toolkit 1.5 it works fine.. Can any body help me regarding this issue?

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: LWUIT Image-IOException

    Quote Originally Posted by minhaaj anwaar View Post
    background images are not binding to my forms when I use lwuit toolkit 1.0 although images on buttons binds okay. Whereas if I use lwuit toolkit 1.5 it works fine.. Can any body help me regarding this issue?
    It may have something to do with the 5 steps in version number over the 4 years passed between the two releases. Some LWUIT versions are simply not available right now, but even version 1.3 reports a bugfix related to the background of a form: "•Minor fix to Form to allow override paintBackground". So it may easily happen that using image backgrounds in forms simply did not work with 1.0.
    An other reading: I assume that the background image is much larger than the others, and thus the decoder may simply run out of memory. It is also something what could have been addressed/optimized over the years.

Similar Threads

  1. IOException when loading an image
    By cjohnstone in forum Mobile Java Media (Graphics & Sounds)
    Replies: 9
    Last Post: 2008-03-05, 07:36
  2. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  3. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  4. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31
  5. Loading Image data from 'raw' bytes
    By LongSteve in forum Mobile Java General
    Replies: 2
    Last Post: 2002-11-20, 17:38

Posting Permissions

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