Trying to create a DvbBufferedImage but its width and height are 0

76 views Asked by At

I'm trying to create a fade-in animation using DvbBufferedImage for my BD-J application by changing alpha value of the images,

doubleBuffer = new DVBBufferedImage(1920, 2180, DVBBufferedImage.TYPE_ADVANCED);

but after it creates the buffer, its width and height are 0 and when I'm trying to get graphics:

DVBGraphics bufferGraphics = doubleBuffer.createGraphics();

It returns null.

after that, I want to draw images onto buffer and I get NullPointerException. Do you have and suggestion? I think it is related to my libraries, because when I replaced DvbBufferedImage with BufferedImage using this code:

protected BufferedImage bufImage = new BufferedImage(1920, 2180, BufferedImage.TYPE_INT_ARGB );

it says :

The constructor BufferedImage(int, int, int) is undefined

I mention that I'm using customized eclipse for developing Bd-j Applications and my java version is jre1.8.0_77.

Classes used for this application listed below:

basis.jar
btclasses.zip
j2me_xml_cdc.jar
javatv.jar
jsse-cdc.jar
pbp_1_0.jar
SonicBDJ.jar

Your help will be appreciated on this problem, Thanks in advance!

1

There are 1 answers

0
mr_lou On

This could be related to a memory issue.

Blu-ray Players are only required to have 4 mb of memory according to the specification. This includes the space for the actual JAR file currently loaded. So if you're using an image of 1920x2180 pixels in high quality, then your JAR is probably already taking up 1-2 mb. Then loading that image into memory might cause an OutOfMemoryException, which means the image won't be loaded, which is why you get the NullPointerException.

Blu-ray Disc Java is JavaME. We're dealing with a limited platform. ;-)