This discussion is archived
2 Replies Latest reply: Jan 24, 2010 7:26 PM by 843851 RSS

doubts on HBackgroundImage

843851 Newbie
Currently Being Moderated
My problem is im trying to add a BackgroundImage but the image is not loading on the bcakground.Moreover how to add it to the container.
Any cue on why this is happening.
Another doubt is the constructor's parameter string,as to what it should be if my image file is in the same folder as the prog.My background part of code is

fullContainer=new HContainer(50,50,500,500);
HBackgroundImage hbi;
Toolkit tool=Toolkit.getDefaultToolkit();
String s="baba.gif";
hbi=new HBackgroundImage(s);

//fullContainer.add(hbi); this is not working and showing error
  • 1. Re: doubts on HBackgroundImage
    843851 Newbie
    Currently Being Moderated
    If you want to add a background image you must add it in the Background Layer, adding a container with an HBackgroundImage has no sense.

    You must get and reserve the HBackgroundDevice and set its preference of STILL_BACKGROUND to make it able to have an image as background with a template. After aplying this configuration to the background device it will be able to run its method .displayImage(HBackgroundImage hbi) And you will be able to see the background as soon as move the video layer or reduce it.

    Remember that if you are using XletView you will able to use a .jpg or .gif image as the background image but if you're gonna work over a real STB you should use a .mpg file containing an I-frame with the image
  • 2. Re: doubts on HBackgroundImage
    843851 Newbie
    Currently Being Moderated
    Hi,

    I was successful in displaying an i-frame (saved as .mpg file) after creating & loading a HBackgroundImage onto the HBackgroundDevice using HAVi.
    However, I get the data bytes from the Heap in real-time. If I try to create an instance of HBackgroundImage from those bytes and try to load it, the imageLoadFailed() gets invoked on the HBackgroundImageListener. Has this something to do with how the bytes were encoded?

    Could you help me on this? Thanks very much in advance!

    Rahul