×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    3

    How to make the PNG image cover the display?

    I have a general problem with PNG images. When I create a Canvas which only purpose is to display a splash screen there is a title in top of the screen with the appication name.

    I want the picture to cover the complete screen. Instead there is a title on top of the page and then the picture.

    My code looks like!

    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;

    public class IntroCanvas extends Canvas implements CommandListener
    {
    private Image splash;
    private TestMIDlet parent;
    public IntroCanvas(TestMIDlet parent)
    {
    this.parent = parent;
    try
    {
    splash = Image.createImage("/TestScreen.png");
    }
    catch (Exception e)
    {
    }
    }
    protected void paint( Graphics p1 )
    {
    p1.drawImage(splash, 0, 0, Graphics.TOP | Graphics.LEFT);
    }

    public void commandAction( Command p1, Displayable p2 )
    {
    }
    }
    What am I doing wrong?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    26
    Very simple answer:

    You are using Canvas

    You need to use FullCanvas

    You see, Canvas() includes the title at the top - you cannot get rid of that... unless you use FullCanvas() which gives you control of the entire screen!

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    3

    Thanks!

    Ok!

    Thanks a lot. I was going crazy before, but not it works perfect (using FullCanvas)!!!


    /Gold

Posting Permissions

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