×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    27

    Creating a jpg image on the 6131 NFC

    Hi all,

    I try to read a jpg file from a tag and display it on the phone, but it doesn´t work!!
    I just assume that the phone supports jpg!!

    Heres my code:
    //pictureData is a byte[] where the received jpg data is stored!!
    Image picture = Image.createImage(pictureData, 0, pictureData.length);
    form.append(picture);

    But i get an "IllegalArgumentException"!!

    Would be glad, if anyone who did this before would post some example code!!

    -Thanx

  2. #2
    Nokia Developer Expert
    Join Date
    Oct 2005
    Posts
    21

    Re: Creating a jpg image on the 6131 NFC

    Hi,

    6131 NFC supports jpeg images.

    MIDP 2.0 Javadocs says following about Image.createImage(byte[] imageData, int imageOffset, int imageLength);
    "IllegalArgumentException - if imageData is incorrectly formatted or otherwise cannot be decoded."

    So there might to be something wrong in the given byte array containing jpeg image.

    There is also example about writing image to tag and reading it in Wiki page, that might be useful: http://wiki.forum.nokia.com/index.ph...ge_to_NDEF_tag

  3. #3
    Registered User
    Join Date
    Jun 2007
    Posts
    27

    Re: Creating a jpg image on the 6131 NFC

    Thanks for the fast reply!!
    It´s good to know that my code is correct, so I can figure out what is wrong with my received data!!

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    27

    Re: Creating a jpg image on the 6131 NFC

    Hi,

    it turned out, that i did´t have the correct data in my array, because i had to cut off some more overhead!!

    Now it works, but there is one thing i need to know:
    How do I resize the picture to make it fit the screen??
    I guess i should do something likes this:
    Image picture1 = Image.createImage(pictureData, 0, pictureData.length);
    Image picture2 = Image.createImage(picture1, 0, 0, picture1.getWidth(), picture1.getHeight(), int transform);
    form.append(picture2);

    What is the "int transform" good for?? can i use this argument to make the picture smaller (or larger)???

    I read the specification on javax.microedition.lcdui.Image, so please don´t just post that!!

Similar Threads

  1. Nokia 6131 NFC SDK v. 1.1 has been released!
    By Raluca_ in forum Near Field Communication
    Replies: 8
    Last Post: 2008-05-29, 13:54
  2. Nokia 6131 NFC SDK 1.0 has been released
    By Nokia Ron in forum Near Field Communication
    Replies: 0
    Last Post: 2007-03-26, 22:28
  3. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  4. 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
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

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