Painting the background
Hi everyone. I have a little question.
I'm trying to make my application draw some background images (in the HBackground) And everything seems to be ok except when the image is drawed. It appears but distorted. I first put the background and then reduce the video playing so te background could be seen. Maybe I have to reduce the video first? For reducing it I use the AWTVideoSizeControls and ServiceContext way
This is the little piece of code for painting the background
publicvoid cambiar_fondo_imagen(String imagen){
HBackgroundConfigTemplate plantilla =new HBackgroundConfigTemplate();
plantilla.setPreference(HBackgroundConfigTemplate.FLICKER_FILTERING, HBackgroundConfigTemplate.REQUIRED);
plantilla.setPreference(HBackgroundConfigTemplate.STILL_IMAGE, HBackgroundConfigTemplate.REQUIRED);
HBackgroundConfiguration config = planoBackground.getBestConfiguration(plantilla);
HStillImageBackgroundConfiguration configStill =null;
if (configinstanceof HStillImageBackgroundConfiguration){
configStill = (HStillImageBackgroundConfiguration)config;
}
planoBackground.reserveDevice(this);
try{planoBackground.setBackgroundConfiguration(configStill);}
catch (Exception e){System.out.println("Excepcion: " + e);}
if (config !=null){
HBackgroundImage imagenFondo =new HBackgroundImage(imagen);
try{configStill.displayImage(imagenFondo);}
catch (Exception e){System.out.println("Excepcion: " + e);}
}
}
Maybe I may change some HBackgroundConfigTemplate options? (I'm using an i-frame of a mpg as the background image)

