×

Discussion Board

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

    createImage(byte[],int,int) bug on Nokia 7650

    I've found a problem after several (300+) calls to createImage(byte[],int,int) on 7650. The function can not create image
    The test program works well on other phones, but halts on 7650... I can email my sources to developers, if they want.
    Thanks and sorry for my poor English.

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

    RE: createImage(byte[],int,in t) bug on Nokia 7650

    Hi bachin,
    I suppose your code looked as following:
    ...
    is = conn.openInputStream();
    byte [] buffer = new byte[(int)conn.getLength()];
    is.read(buffer);
    is.close();
    Image image = Image.createImage(buffer,0,buffer.lenght); ... and so on
    ...
    it's ok but unfortunetaly doesn't work on N7650 appart from
    N6310i

    for N7650 the solution is:
    ....
    is = conn.openInputStream();
    byte [] buffer = new byte[(int)conn.getLength()];
    /*****************************************************/

    int readLength;
    int startRead = 0;
    int endRead = (int)conn.getLength();
    do {
    readLength = is.read(buffer,startRead,endRead);
    startRead = readLength;
    endRead = endRead - startRead;
    }
    while(endRead > 0);
    /*********************************************************/
    is.close();
    Image image = Image.createImage(buffer,0,buffer.lenght);
    ...
    surely it works on both phones. :-)

    I hope it will help you,
    regards,
    Janek

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

    RE: createImage(byte[],int,in t) bug on Nokia 7650

    No, I do not use connections.
    My program used alot of images and I've stored them into resource.
    On load I read this byte array without any calls to createImage.
    When my program needs the particular image - it accesses to this byte array and gets the image from it. And it doesn't work after several calls.
    Fortunately, now I can store all my images in memory in this particular program, so I'm not forced to call the createImage function again and again. My post is only a bugreport for developers. Anyway, thanks for your comment.

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    39

    Re: createImage(byte[],int,int) bug on Nokia 7650

    I know this is a post that is 2 years ago, but I believe many people are still working on 7650, can anyone verify that this is indeed a 7650 specific bug?
    I know this is a bug scarcely encountered in most developers, but I need to call createImage(byte[], int, int) constantly in my game and it crashes the game with the same IllegalArgumentException!
    As far as I know, Nokia did not verify it in any documents, correct me if I'm wrong.

Posting Permissions

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