×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    26

    Retrieving and display a jpeg-picture?

    Hi there,
    is it possible to retrieve a jpg-picture from an URL with the CLDC/MIDP-Specification? The Image.createImage-method only supports pics in the "png" format,or? Unfortunately, ive no Server-access, so converting the jpg on the server before retrieving the pic isnt possible. Does The NokiaUI support this? Or maybe someone has a workaround for my problem?

    Thanks for help!

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    33

    RE: Retrieving and display a jpeg-picture?

    You say you have no server access, but what URL do you want to retrieve the image from? I assume, from a server? So, in that case, you should be able to convert it on the server to PNG, and retrieve that. Other than this, i don't think there's a way to read JPG images using MIDP 1. With MIDP 2, you might be able to create your own JPG/PNG converter directly in the phone, because in MIDP 2 you have access to the image data array. Not so in MIDP 1. So i suggest using just PNG files, and if you need JPG, convert it on the server. That's the only way for now.

    Regards,
    -- Niek

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    34

    RE: Retrieving and display a jpeg-picture?

    You are able to read JPG files even in MIDP 1.0.

    But for this you will need to implement the following :

    1) JPGDecoder which reads JPG file to some OurFormatFile, like array of RGB integers...
    2) PNGEncoder, which gets an array of RGB integers and returns the byte[] array which contains completed PNG file(with all headers and data)
    3) use Image.createImage(byte encodedpng[]) where encodedpng is the result of PNGEncoder work
    4) Enjoy


    Best Regards,
    Eugene Yatsenko.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    34

    RE: Retrieving and display a jpeg-picture?

    Hi Elwoodini,

    Contact me in ICQ : 31824770,
    or MSN : eugeneyatsenko@hotmail.com
    I'll try to tell you more

    Best Regards,
    Eugene Yatsenko.

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    22

    autoexec

    Will you give a specification of PNG and JPG?
    And can I read data from a JPG file with MIDP1.0 ?

    Thanks in advance
    zhang

  6. #6
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Will you give a specification of PNG and JPG?
    You can find that on http://www.wotsit.org.
    And can I read data from a JPG file with MIDP1.0 ?
    No, you can't. But if he is downloading the image from the web then he is getting all the data as bytes from the input stream. So he is getting the image as a byte array to begin with.

    shmoove

Posting Permissions

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