×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    6

    my Alert Image is out of the screen

    Hi there,
    I'm using the following code to create an alert to display on the Nokia S40 emulator I use :

    _image = Image.createImage("/mylogo.PNG");
    _alert = new Alert("RFID online","",_image,AlertType.INFO);

    but the image is drawn mosty out of the screen : only its bottom left part is displayed in the right top corner of the screen.

    I tried to copy this immutable image in a mutable one, using this code :
    Image copy = Image.createImage(_image.getWidth(), _image.getHeight());
    Graphics g = copy.getGraphics();
    g.drawImage(_image, 0, 0, Graphics.TOP|Graphics.LEFT);

    with several different values for the drawImage() method, but the only thing i could do was changing the part of the original image displayed in the right top corner of the S40 screen.

    I could not find any method in the classes Image or Alert to draw the Image at the right place...
    Any idea someone ?

    Cheers,
    Romain

  2. #2
    Registered User
    Join Date
    Mar 2005
    Posts
    34
    Have you tried ensuring that the height and width of the screen, alert, and picture are all compatible?

    I would also try creating the alert, then setting the image using the setImage(Image img) method.

    I hope that helps, or at least rules out a few more options,

    Åge Kruger

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    6
    Thanks for trying !

    But unfortunately, setting the image after the creation of the Alert didn't change the result :S
    Besides there is no incompatibility between the screen and the picture. What do you mean by compatibility with the Alert ? I did not see any attributes of length or height for an Alert, but I may be wrong
    Cheers. Romain.

  4. #4
    Registered User
    Join Date
    Mar 2005
    Posts
    34
    The Alert class inherits a getHeight and getWidth method from Displayable.

    Åge Kruger

Posting Permissions

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