×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    6

    Diplay gif image doesn't work!!!

    Hi everyone
    I've tried to display gif image on form.
    However, it doesn't work.

    This is my code

    //***********

    import java.io.*;
    import javax.microedition.media.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.media.control.*;

    public class GifPlayer extends MIDlet {

    private Player player;
    private GUIControl gui;
    private Form form;

    public void startApp() {
    this.play();
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void play() {
    form = new Form("Play Gift");

    try {
    InputStream in = getClass().getResourceAsStream("/image/load.gif");
    player = Manager.createPlayer(in,"image/gif");
    gui = (GUIControl) player.getControl("GUIControl");
    player.realize();
    player.prefetch();
    if (gui != null) {
    Item vi = (Item) gui.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null);
    form.append(vi);
    Display.getDisplay(this).setCurrent(form);
    player.start();
    }
    } catch (Exception ex) {
    ex.printStackTrace();
    }

    }

    }


    Please could you help me to solve this problem.

    Thanks


    embarus

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: Diplay gif image doesn't work!!!

    Please take use of png images.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  3. #3
    Super Contributor
    Join Date
    Jun 2007
    Location
    Mumbai
    Posts
    539

    Re: Diplay gif image doesn't work!!!

    gif is not supported on many phones. Take out frames of gif as png images and animate this your self over a thread.
    au revoir
    Prakash Raman

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

    Re: Diplay gif image doesn't work!!!

    Hi,
    Not all devices supports the gif extension,you have to check the forum for the same,
    http://www.forum.nokia.com/devices/matrix_all_1.html
    PNG extension is used worldwide in order to make the application/games as portable.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. threading image to a gif image ? (j2me)
    By intheworldofmyown in forum Mobile Java General
    Replies: 3
    Last Post: 2008-11-18, 17:31
  2. Image Problem
    By Spider_Eg in forum Mobile Java General
    Replies: 2
    Last Post: 2007-01-30, 13:52
  3. Camera captured stream to GIF image??!!
    By abolfoooud in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2007-01-08, 11:21
  4. Drawing Lines on an Image (image graphics object returns null)
    By nicenouman in forum Mobile Java General
    Replies: 4
    Last Post: 2006-09-21, 10:15
  5. transparent image draw dont work
    By pekkert in forum Mobile Java General
    Replies: 0
    Last Post: 2003-04-23, 09:48

Posting Permissions

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