×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    2

    how to display image?

    hai, I need to show the image in the screen.The image is in the server and has to be downloaded, which I was able to figure out.

    But the image in server is a bmp or jpeg format and midp accepts png only(I think so?) . Is there any way to directly display a bmp or jpeg? or how a bmp or jpeg image can be saved in png format in the server ie j2se envirorment.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Rotterdam, Holland
    Posts
    118
    No, unless you write your own image decompressor for JPG/GIF it's not possible, and from experience i know that neither is an easy thing to do (both use recursive/fractal based compression). Just make sure it is provided as a PNG byte stream and pass it to Image.createImage with such a bytestream as a parameter.

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    2

    another solution

    Thanks for your answer. I would like to share something interesting that I found regaurding the topic. SourceForge.net site has a lot of interesting projects. One among them is "gtgl". It's a graphics library. I ran the demo that came with the doc, It was great. It was able to load jpeg images. Ofcourse it does that by having its own jpeg and gif coder.

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Rotterdam, Holland
    Posts
    118
    I'm guessing the footprint of that API is rather large though.

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    It depends on what you're targeting.

    The MIDP specification only requires implementations to support PNG... it doesn't prevent them from supporting anything else. Many Nokia phones will handle JPEG images, for example. You should be able to determine if a device will support an image type by trying to use one, and seeing if you get an exception thrown.

    This is, of course, no use if you need generic MIDP support. You would need to know (or have some control over) the specific device for which you are developing.

    Graham.

  6. #6
    Registered User
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1

    Cannot find GTGL

    Hi,
    Can you help me with the following questions,
    i) I cannot find gtgl in sourceforge.net. Do you know how I can find it?
    ii) Can some Nokia phones such as 6600 and 7650 display JPEG images without any extra J2ME classes?
    iii) I don't want to program my JPEG codec, is there any source code available that we can use?

    Thanks for your help!
    A very desparate man ...

  7. #7
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Rotterdam, Holland
    Posts
    118
    i) I cannot find gtgl in sourceforge.net. Do you know how I can find it?
    Nope

    ii) Can some Nokia phones such as 6600 and 7650 display JPEG images without any extra J2ME classes?
    Yes, as long as the format is both supported by the device and format information is present in the byte array (meaning, if it can figure out it's reading GIF, JPEG or PNG data from the stream instead of the extension for example, GIF, JPEG en PNG all qualify though).

    iii) I don't want to program my JPEG codec, is there any source code available that we can use?
    Try sourceforge, you really should try to work around writing or using a custom decoder though, it's a big bulk of code and potentially buggy, version dependant etc.

  8. #8
    Registered User
    Join Date
    Jun 2004
    Location
    near Amsterdam
    Posts
    1
    -----------------------------------------------------------------------------
    ii) Can some Nokia phones such as 6600 and 7650 display JPEG images without any extra J2ME classes?
    Yes, as long as the format is both supported by the device and format information is present in the byte array (meaning, if it can figure out it's reading GIF, JPEG or PNG data from the stream instead of the extension for example, GIF, JPEG en PNG all qualify though).
    -----------------------------------------------------------------------------------

    Does this automatically means that you can use the createImage method with a bytebuffer argument that is filled from a jpg?

    or will this still return an illegalArgumentException

    Another oftopic question: Where do you find phone specific emulators. Till now im still using serie 40 or serie 60 from nokia. But i do want to test on a 6600 emulator for instance.

  9. #9
    Registered User
    Join Date
    Apr 2004
    Posts
    14

    Webviewer

    There are some applications like webviewer
    which is present in http://www.midlet.org
    this application is used to see a html content
    in ur device its a HTML browser made in J2ME
    for java enabled device and it also converts
    images from jpeg or gif to pngs to display it
    in the Canvas.
    I am surprised to see that.
    I don know how it works.

Posting Permissions

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