Skip to main content

DVBBufferedImage and Graphics2D

2 replies [Last post]
ebiancarelli
Offline
Joined: 2008-02-13
Points: 0

I've got the following code that I think should work, but is giving a ClassCastException:
Object o = ((DVBBufferedImage)buffer).createGraphics();
return (Graphics2D) o;

DVBBufferedImage.createGraphics() should return a DVBGraphics object. And in the DVBGraphics JavaDoc it states:
In implementations where the class java.awt.Graphics2D is visible to MHP applications, org.dvb.ui.DVBGraphics inherits from java.awt.Graphics2D. Otherwise, org.dvb.ui.DVBGraphics inherits from java.awt.Graphics.

I thought the OCAP-RI has support for Graphics2D? This file seems to hint that Graphics2D is supported:
./OCAP-1.0/java/src/base/com/vidiom/impl/dvb/ui/DVBGraphicsImpl2.java

Thanks in advance,
Ernie

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ebiancarelli
Offline
Joined: 2008-02-13
Points: 0

I solved my own problem by having DVBGraphics extend Graphics2D instead of Graphics.

csweeney
Offline
Joined: 2009-04-11
Points: 0

Thanks for the info.