×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    2

    Image.createImage for ur help plz

    class keyEventCanvas extends Canvas
    {
    int width, height;
    private Image image0;
    private Image image1;
    private Image image2;
    private Image image3;
    private Image image4;
    private Image image5;
    private Image image6;
    private Image image7;
    private Image image8;
    private Image image9;
    public keyEventCanvas()
    {
    width = this.getWidth();
    height = this.getHeight();

    try
    {
    image0= Image.createImage("/bear.png");
    image1= Image.createImage("/1.png");
    image2= Image.createImage("/2.png");
    image3= Image.createImage("/3.png");
    image4= Image.createImage("/4.png");
    image5= Image.createImage("/5.png");
    image6= Image.createImage("/6.png");
    image7= Image.createImage("/7.png");
    image8= Image.createImage("/8.png");
    image9= Image.createImage("/9.png");
    }catch(Exception pp){};
    }


    if i put 4 or more Image.createImage in try{} , it will be a error of unable to run application, but i put 3 or fewer than 3 Image.createImage it works.... @@

    how can i do for this problem? can anyone help me? thanks

    PS: run on Jbuilder 9 with Nokia_7210_MIDP_SDK_v1_0

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Let me guess, those images are quite big (I mean resolution-wise). Keep in mind that when you create an image it will be loaded into memory using the phones native format, which on Series 40 phones means it takes up 2 bytes per pixel and a few more bytes overhead per image. So for example a full-screen (128*128) image for a Series 40 phone takes more than 32 KB. The heap size is around 200 KB for all the loaded resources and classes and stuff, and once you cross that limit you get the "Unable to run application" message.

    shmoove

Posting Permissions

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