×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    9

    Image.createImage --> one picture works, the other one not?

    Hello,

    i am going to be insane right now. I used an png image wich works fine. After that, i tried to create another
    Image wich is in the same directory as the image i used before but it doesnt work??! The images are nearly the same (bitdepth, size, resolution)
    but it doesnt work..
    Error Msg:

    Error
    Uncaught exception java/lang/NullPointerException: .


    try{
    platzhalter = Image.createImage("/channel_unselected.png");
    }catch(IOException e){
    System.out.println("Error");
    }

    It cant be a question of code because it works with an amount of pictures, but not with all. Are there any limitations of the sizes, bitdepths ... for the used pictures??

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Image.createImage --> one picture works, the other one not?

    Well... there are limitations as to size. Bigger pictures need more memory. Memory limits the total number of pixels that can be loaded.

    What device are you working on? How many images, and what sizes? (By "size", I mean the pixel dimensions of the images, not the byte size of the PNG files.)

    Are the file names correct? They must match the file name as it appears in the JAR precisely (file names in the JAR are case sensiteive).

    Cheers,
    Graham.

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

    Thumbs up Re: Image.createImage --> one picture works, the other one not?

    Quote Originally Posted by stechbeitel View Post
    Error
    Uncaught exception java/lang/NullPointerException: .


    try{
    platzhalter = Image.createImage("/channel_unselected.png");
    }catch(IOException e){
    System.out.println("Error");
    }
    Hi,
    Just need to check,the name of the image...thats all.
    Name of the image is not correct..just check it out.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: Image.createImage --> one picture works, the other one not?

    check that image u r creating is null or not..

    if (image == null)
    sout("null");
    else
    sout("not null");

    might be there is some issue with name of file. Please check the file name as raj_j2me and graham suggested..
    thanks,
    jitu_goldie..

    KEEP TRYING..

  5. #5
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    89

    Re: Image.createImage --> one picture works, the other one not?

    Hi,

    Where u getting the exception in device or emulator.
    If u getting an exception on device then try on emulator. If it's work fine on emulator then go for Graham suggestion.

    Let me know.

    Thanks
    Osam

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

    Re: Image.createImage --> one picture works, the other one not?

    Hi stechbeitel,
    can you share that which device you are working with?
    And are you getting the exception with that image only?
    or you are not just able to load the second image,after loading the first image...
    Can you try to load just this image only..?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. Replies: 4
    Last Post: 2006-08-30, 10:15
  2. problem in 6630 with picture sms
    By inspirebaby in forum General Messaging
    Replies: 0
    Last Post: 2006-02-03, 01:55
  3. how to add picture to the profile
    By venkatareddy in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-03-17, 05:45
  4. Has Nokia broken 7650 J2ME in v4.39?
    By LongSteve in forum Mobile Java General
    Replies: 6
    Last Post: 2003-06-03, 17:05
  5. Nokia 6310 + Non Nokia BT card + Nokia PC Suite 4.5a -> works
    By mkoller in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-08-09, 08:09

Posting Permissions

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