×

Discussion Board

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

    Can't display an Images on S60 emulator without Symbiam

    Hi,

    I'm going to display 5 images in a FullCanvas together. However, I don't know why the images cannot be displayed in the emulator without symbiam. But it works fine with S60 for Symbian OS.

    I use this command to load all the image:

    Image myImage;

    public myCanvas
    {
    myImage = Image.createImage("/res/image/myImage.png");
    ...
    }
    public paint(Graphics g)
    {
    g.drawImage(myImage,0,0,Graphics.TOP|Graphics.LEFT);
    }

    The image was created with PhotoShop 6.0. If saving with "none option", It returns "null" while loading image. If saving with "Interlaced option", it returns "NullPointerException" while drawing the image.

    But itworks perfect with Symbian OS.

    Can u give me some suggestion?

    Thanks!

    Yours,

    Elim.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    371
    This looks like Java code, so I moved this to Java forum.

    Best Regards,
    Marko / Forum Nokia

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

    Create Images wiht J2ME

    When you works with J2ME you need to have all the resources in \res directory, but when you want call this files, the path is without "\res".
    Example:

    *AppDirectory\res\logo.png

    Image logo;

    try{

    logo = Image.createImage("\logo.png");

    .....

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Helsinki.FI
    Posts
    112
    Hi,

    this seems to be wrong:
    ...
    myImage = Image.createImage("/res/image/myImage.png");
    ...

    Try the following instead:
    public myCanvas
    {
    myImage = Image.createImage("\image\myImage.png");
    ...
    }

    I don't know about Photoshop, but if "None option" saves the image as normal, it should work fine if you just save it as Your_MIDP_App_Dir\res\image\myImage.png as stated in the precious example. Interlaced images do not work.

    Kind regards,
    Tinke / FN

Posting Permissions

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