I want to make an application that takes a snapshot from Camera and send it to the server. I can do this pretty easily in Highlevel UI using MediaPlayer but it seem that I can't use the same code in LWUIT.

VideoControl vc;

Item videoItem = (Item) vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);

Since it didn't work I used the MediaComponent.

MediaComponent videoItem =  (MediaComponent) vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);

but it didn't work either. A class cast exception is thrown. Can you please tell me how to implement it.

有帮助吗?

解决方案

You don't need to call initDisplayMode for LWUIT. This is invoked internally by LWUIT, just add the video item to the LWUIT Form and the initDisplayMode method will be invoked for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top